From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 00:57:56 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E722106566C; Sun, 30 Oct 2011 00:57:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8558FC08; Sun, 30 Oct 2011 00:57:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9U0vu79040707; Sun, 30 Oct 2011 00:57:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9U0vudK040704; Sun, 30 Oct 2011 00:57:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201110300057.p9U0vudK040704@svn.freebsd.org> From: Attilio Rao Date: Sun, 30 Oct 2011 00:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226920 - in user/attilio/vmcontention/sys/amd64: amd64 include X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 00:57:56 -0000 Author: attilio Date: Sun Oct 30 00:57:56 2011 New Revision: 226920 URL: http://svn.freebsd.org/changeset/base/226920 Log: Reimplement the splay tree used for idle page table pages using md_page iterators. Additively, embed the left and right pointers as an union with the pv_list as the page table pages don't need reverse mapping. This way, this code is no longer using the root and left iterators from the vm_page itself and once the red/black algorithm for cached pages will be implemented will allow removing completely the extra two pointers from vm_page. Implementation notes: it is interesting to note that now pmap_vmpage_splay() is just a copy&paste of the vm_page_splay(), but working on the md_page iterators. This is necessary because in the end the vm_page_splay() will be completely removed. Also, note that pv_list iterator is renamed in a more "common" way because of problems with macro expansions. Outlined, discussed and reviewed by: jeff Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c user/attilio/vmcontention/sys/amd64/include/pmap.h Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sat Oct 29 23:53:58 2011 (r226919) +++ user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sun Oct 30 00:57:56 2011 (r226920) @@ -265,6 +265,7 @@ static boolean_t pmap_try_insert_pv_entr static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde); static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); +static vm_page_t pmap_vmpage_splay(vm_pindex_t pindex, vm_page_t root); static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); @@ -1461,20 +1462,20 @@ pmap_insert_pt_page(pmap_t pmap, vm_page PMAP_LOCK_ASSERT(pmap, MA_OWNED); root = pmap->pm_root; if (root == NULL) { - mpte->left = NULL; - mpte->right = NULL; + mpte->md.pv_left = NULL; + mpte->md.pv_right = NULL; } else { - root = vm_page_splay(mpte->pindex, root); + root = pmap_vmpage_splay(mpte->pindex, root); if (mpte->pindex < root->pindex) { - mpte->left = root->left; - mpte->right = root; - root->left = NULL; + mpte->md.pv_left = root->md.pv_left; + mpte->md.pv_right = root; + root->md.pv_left = NULL; } else if (mpte->pindex == root->pindex) panic("pmap_insert_pt_page: pindex already inserted"); else { - mpte->right = root->right; - mpte->left = root; - root->right = NULL; + mpte->md.pv_right = root->md.pv_right; + mpte->md.pv_left = root; + root->md.pv_right = NULL; } } pmap->pm_root = mpte; @@ -1493,7 +1494,7 @@ pmap_lookup_pt_page(pmap_t pmap, vm_offs PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((mpte = pmap->pm_root) != NULL && mpte->pindex != pindex) { - mpte = vm_page_splay(pindex, mpte); + mpte = pmap_vmpage_splay(pindex, mpte); if ((pmap->pm_root = mpte)->pindex != pindex) mpte = NULL; } @@ -1512,18 +1513,24 @@ pmap_remove_pt_page(pmap_t pmap, vm_page PMAP_LOCK_ASSERT(pmap, MA_OWNED); if (mpte != pmap->pm_root) { - root = vm_page_splay(mpte->pindex, pmap->pm_root); + root = pmap_vmpage_splay(mpte->pindex, pmap->pm_root); KASSERT(mpte == root, ("pmap_remove_pt_page: mpte %p is missing from pmap %p", mpte, pmap)); } - if (mpte->left == NULL) - root = mpte->right; + if (mpte->md.pv_left == NULL) + root = mpte->md.pv_right; else { - root = vm_page_splay(mpte->pindex, mpte->left); - root->right = mpte->right; + root = pmap_vmpage_splay(mpte->pindex, mpte->md.pv_left); + root->md.pv_right = mpte->md.pv_right; } pmap->pm_root = root; + + /* + * Reinitialize the pv_list which could be dirty now because of the + * splay tree work. + */ + TAILQ_INIT(&mpte->md.pv_list); } /* @@ -1599,6 +1606,61 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of } /* + * Implements Sleator and Tarjan's top-down splay algorithm. Returns + * the vm_page containing the given pindex. If, however, that + * pindex is not found in the pmap, returns a vm_page that is + * adjacent to the pindex, coming before or after it. + */ +static vm_page_t +pmap_vmpage_splay(vm_pindex_t pindex, vm_page_t root) +{ + struct vm_page dummy; + vm_page_t lefttreemax, righttreemin, y; + + if (root == NULL) + return (root); + lefttreemax = righttreemin = &dummy; + for (;; root = y) { + if (pindex < root->pindex) { + if ((y = root->md.pv_left) == NULL) + break; + if (pindex < y->pindex) { + /* Rotate right. */ + root->md.pv_left = y->md.pv_right; + y->md.pv_right = root; + root = y; + if ((y = root->md.pv_left) == NULL) + break; + } + /* Link into the new root's right tree. */ + righttreemin->md.pv_left = root; + righttreemin = root; + } else if (pindex > root->pindex) { + if ((y = root->md.pv_right) == NULL) + break; + if (pindex > y->pindex) { + /* Rotate left. */ + root->md.pv_right = y->md.pv_left; + y->md.pv_left = root; + root = y; + if ((y = root->md.pv_right) == NULL) + break; + } + /* Link into the new root's left tree. */ + lefttreemax->md.pv_right = root; + lefttreemax = root; + } else + break; + } + /* Assemble the new root. */ + lefttreemax->md.pv_right = root->md.pv_left; + righttreemin->md.pv_left = root->md.pv_right; + root->md.pv_left = dummy.md.pv_right; + root->md.pv_right = dummy.md.pv_left; + return (root); +} + +/* * After removing a page table entry, this routine is used to * conditionally free the page, and manage the hold/wire counts. */ @@ -2105,7 +2167,7 @@ pmap_collect(pmap_t locked_pmap, struct TAILQ_FOREACH(m, &vpq->pl, pageq) { if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy) continue; - TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { + TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_next, next_pv) { va = pv->pv_va; pmap = PV_PMAP(pv); /* Avoid deadlock and lock recursion. */ @@ -2129,7 +2191,7 @@ pmap_collect(pmap_t locked_pmap, struct pmap_unuse_pt(pmap, va, *pde, &free); pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); @@ -2277,9 +2339,9 @@ pmap_pvh_remove(struct md_page *pvh, pma pv_entry_t pv; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); break; } } @@ -2312,7 +2374,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse pv = pmap_pvh_remove(pvh, pmap, va); KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found")); m = PHYS_TO_VM_PAGE(pa); - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); /* Instantiate the remaining NPTEPG - 1 pv entries. */ va_last = va + NBPDR - PAGE_SIZE; do { @@ -2353,7 +2415,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs pv = pmap_pvh_remove(&m->md, pmap, va); KASSERT(pv != NULL, ("pmap_pv_promote_pde: pv not found")); pvh = pa_to_pvh(pa); - TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); /* Free the remaining NPTEPG - 1 pv entries. */ va_last = va + NBPDR - PAGE_SIZE; do { @@ -2405,7 +2467,7 @@ pmap_insert_entry(pmap_t pmap, vm_offset mtx_assert(&vm_page_queue_mtx, MA_OWNED); pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); } /* @@ -2421,7 +2483,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm if (pv_entry_count < pv_entry_high_water && (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2441,7 +2503,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; pvh = pa_to_pvh(pa); - TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2878,7 +2940,7 @@ pmap_remove_all(vm_page_t m) vm_page_dirty(m); pmap_unuse_pt(pmap, pv->pv_va, *pde, &free); pmap_invalidate_page(pmap, pv->pv_va); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -3279,7 +3341,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3959,7 +4021,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -3970,7 +4032,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p } if (!rv && loops < 16) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -4018,7 +4080,7 @@ pmap_pvh_wired_mappings(struct md_page * pv_entry_t pv; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte(pmap, pv->pv_va); @@ -4140,7 +4202,7 @@ pmap_remove_pages(pmap_t pmap) if ((tpte & PG_PS) != 0) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh = pa_to_pvh(tpte & PG_PS_FRAME); - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) if (TAILQ_EMPTY(&mt->md.pv_list)) @@ -4158,7 +4220,7 @@ pmap_remove_pages(pmap_t pmap) } } else { pmap_resident_count_dec(pmap, 1); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); if (TAILQ_EMPTY(&pvh->pv_list)) @@ -4230,7 +4292,7 @@ pmap_is_modified_pvh(struct md_page *pvh mtx_assert(&vm_page_queue_mtx, MA_OWNED); rv = FALSE; - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte(pmap, pv->pv_va); @@ -4300,7 +4362,7 @@ pmap_is_referenced_pvh(struct md_page *p mtx_assert(&vm_page_queue_mtx, MA_OWNED); rv = FALSE; - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte(pmap, pv->pv_va); @@ -4339,7 +4401,7 @@ pmap_remove_write(vm_page_t m) return; vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); va = pv->pv_va; @@ -4348,7 +4410,7 @@ pmap_remove_write(vm_page_t m) (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); } - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pde = pmap_pde(pmap, pv->pv_va); @@ -4398,7 +4460,7 @@ pmap_ts_referenced(vm_page_t m) ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); vm_page_lock_queues(); - TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, pvn) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); va = pv->pv_va; @@ -4431,9 +4493,9 @@ pmap_ts_referenced(vm_page_t m) if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { - pvn = TAILQ_NEXT(pv, pv_list); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + pvn = TAILQ_NEXT(pv, pv_next); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pde = pmap_pde(pmap, pv->pv_va); @@ -4483,7 +4545,7 @@ pmap_clear_modify(vm_page_t m) return; vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); va = pv->pv_va; @@ -4514,7 +4576,7 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pde = pmap_pde(pmap, pv->pv_va); @@ -4549,7 +4611,7 @@ pmap_clear_reference(vm_page_t m) ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); va = pv->pv_va; @@ -4571,7 +4633,7 @@ pmap_clear_reference(vm_page_t m) } PMAP_UNLOCK(pmap); } - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pde = pmap_pde(pmap, pv->pv_va); Modified: user/attilio/vmcontention/sys/amd64/include/pmap.h ============================================================================== --- user/attilio/vmcontention/sys/amd64/include/pmap.h Sat Oct 29 23:53:58 2011 (r226919) +++ user/attilio/vmcontention/sys/amd64/include/pmap.h Sun Oct 30 00:57:56 2011 (r226920) @@ -240,10 +240,20 @@ struct pv_entry; struct pv_chunk; struct md_page { - TAILQ_HEAD(,pv_entry) pv_list; - int pat_mode; + union { + TAILQ_HEAD(,pv_entry) pvi_list; + struct { + vm_page_t pii_left; + vm_page_t pii_right; + } pvi_siters; + } pv_structs; + int pat_mode; }; +#define pv_list pv_structs.pvi_list +#define pv_left pv_structs.pvi_siters.pii_left +#define pv_right pv_structs.pvi_siters.pii_right + /* * The kernel virtual address (KVA) of the level 4 page table page is always * within the direct map (DMAP) region. @@ -282,7 +292,7 @@ extern struct pmap kernel_pmap_store; */ typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ - TAILQ_ENTRY(pv_entry) pv_list; + TAILQ_ENTRY(pv_entry) pv_next; } *pv_entry_t; /* From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 11:11:05 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1460A106568A; Sun, 30 Oct 2011 11:11:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B3D8FC14; Sun, 30 Oct 2011 11:11:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UBB5db065596; Sun, 30 Oct 2011 11:11:05 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UBB4jE065591; Sun, 30 Oct 2011 11:11:04 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201110301111.p9UBB4jE065591@svn.freebsd.org> From: Jeff Roberson Date: Sun, 30 Oct 2011 11:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226930 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:11:05 -0000 Author: jeff Date: Sun Oct 30 11:11:04 2011 New Revision: 226930 URL: http://svn.freebsd.org/changeset/base/226930 Log: - Support two types of nodes, red and black, within the same radix tree. Black nodes support standard active pages and red nodes support cached pages. Red nodes may be removed without the object lock but will not collapse unused tree nodes. Red nodes may not be directly inserted, instead a new function is supplied to convert between black and red. - Handle cached pages and active pages in the same loop in vm_object_split, vm_object_backing_scan, and vm_object_terminate. - Retire the splay page handling as the ifdefs are too difficult to maintain. - Slightly optimize the vm_radix_lookupn() function. Modified: user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/sys/vm/vm_object.h user/attilio/vmcontention/sys/vm/vm_page.c user/attilio/vmcontention/sys/vm/vm_page.h user/attilio/vmcontention/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h user/attilio/vmcontention/sys/vm/vm_reserv.c user/attilio/vmcontention/sys/vm/vnode_pager.c Modified: user/attilio/vmcontention/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_object.c Sun Oct 30 08:35:19 2011 (r226929) +++ user/attilio/vmcontention/sys/vm/vm_object.c Sun Oct 30 11:11:04 2011 (r226930) @@ -162,6 +162,9 @@ vm_object_zdtor(void *mem, int size, voi vm_object_t object; object = (vm_object_t)mem; + KASSERT(object->resident_page_count == 0, + ("object %p resident_page_count = %d", + object, object->resident_page_count)); KASSERT(TAILQ_EMPTY(&object->memq), ("object %p has resident pages", object)); @@ -170,15 +173,12 @@ vm_object_zdtor(void *mem, int size, voi ("object %p has reservations", object)); #endif - KASSERT(object->cache == NULL, + KASSERT(object->cached_page_count == 0, ("object %p has cached pages", object)); KASSERT(object->paging_in_progress == 0, ("object %p paging_in_progress = %d", object, object->paging_in_progress)); - KASSERT(object->resident_page_count == 0, - ("object %p resident_page_count = %d", - object, object->resident_page_count)); KASSERT(object->shadow_count == 0, ("object %p shadow_count = %d", object, object->shadow_count)); @@ -208,11 +208,7 @@ _vm_object_allocate(objtype_t type, vm_p TAILQ_INIT(&object->memq); LIST_INIT(&object->shadow_head); -#ifdef VM_RADIX object->rtree.rt_root = 0; -#else - object->root = NULL; -#endif object->type = type; object->size = size; object->generation = 1; @@ -230,7 +226,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - object->cache = NULL; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); @@ -307,7 +302,7 @@ vm_object_set_memattr(vm_object_t object case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: - if (!TAILQ_EMPTY(&object->memq)) + if (object->resident_page_count == 0) return (KERN_FAILURE); break; case OBJT_DEAD: @@ -679,7 +674,10 @@ vm_object_destroy(vm_object_t object) void vm_object_terminate(vm_object_t object) { - vm_page_t p, p_next; + vm_page_t pa[VM_RADIX_STACK]; + vm_page_t p; + vm_pindex_t start; + int n, i; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); @@ -724,23 +722,50 @@ vm_object_terminate(vm_object_t object) * from the object. Rather than incrementally removing each page from * the object, the page and object are reset to any empty state. */ - TAILQ_FOREACH_SAFE(p, &object->memq, listq, p_next) { - KASSERT(!p->busy && (p->oflags & VPO_BUSY) == 0, - ("vm_object_terminate: freeing busy page %p", p)); - vm_page_lock(p); - /* - * Optimize the page's removal from the object by resetting - * its "object" field. Specifically, if the page is not - * wired, then the effect of this assignment is that - * vm_page_free()'s call to vm_page_remove() will return - * immediately without modifying the page or the object. - */ - p->object = NULL; - if (p->wire_count == 0) { - vm_page_free(p); - PCPU_INC(cnt.v_pfree); + start = 0; + while ((n = vm_radix_lookupn(&object->rtree, start, 0, VM_RADIX_ANY, + (void **)pa, VM_RADIX_STACK, &start)) != 0) { + for (i = 0; i < n; i++) { + p = pa[i]; + /* + * Another thread may allocate this cached page from + * the queue before we acquire the page queue free + * mtx. + */ + if (p->flags & PG_CACHED) { + mtx_lock(&vm_page_queue_free_mtx); + if (p->object == object) { + p->object = NULL; + p->valid = 0; + /* Clear PG_CACHED and set PG_FREE. */ + p->flags ^= PG_CACHED | PG_FREE; + cnt.v_cache_count--; + cnt.v_free_count++; + } + mtx_unlock(&vm_page_queue_free_mtx); + continue; + } else if (p->object != object) + continue; + KASSERT(!p->busy && (p->oflags & VPO_BUSY) == 0, + ("vm_object_terminate: freeing busy page %p", p)); + vm_page_lock(p); + /* + * Optimize the page's removal from the object by + * resetting its "object" field. Specifically, if + * the page is not wired, then the effect of this + * assignment is that vm_page_free()'s call to + * vm_page_remove() will return immediately without + * modifying the page or the object. + */ + p->object = NULL; + if (p->wire_count == 0) { + vm_page_free(p); + PCPU_INC(cnt.v_pfree); + } + vm_page_unlock(p); } - vm_page_unlock(p); + if (n < VM_RADIX_STACK) + break; } /* * If the object contained any pages, then reset it to an empty state. @@ -748,19 +773,20 @@ vm_object_terminate(vm_object_t object) * modified by the preceding loop. */ if (object->resident_page_count != 0) { - object->root = NULL; TAILQ_INIT(&object->memq); object->resident_page_count = 0; if (object->type == OBJT_VNODE) vdrop(object->handle); } + if (object->cached_page_count != 0 && object->type == OBJT_VNODE) { + object->cached_page_count = 0; + vdrop(object->handle); + } #if VM_NRESERVLEVEL > 0 if (__predict_false(!LIST_EMPTY(&object->rvq))) vm_reserv_break_all(object); #endif - if (__predict_false(object->cache != NULL)) - vm_page_cache_free(object, 0, 0); /* * Let the pager know object is dead. @@ -1235,10 +1261,12 @@ vm_object_shadow( void vm_object_split(vm_map_entry_t entry) { - vm_page_t m, m_next; + vm_page_t ma[VM_RADIX_STACK]; + vm_page_t m; vm_object_t orig_object, new_object, source; - vm_pindex_t idx, offidxstart; + vm_pindex_t idx, offidxstart, start; vm_size_t size; + int i, n; orig_object = entry->object.vm_object; if (orig_object->type != OBJT_DEFAULT && orig_object->type != OBJT_SWAP) @@ -1291,31 +1319,50 @@ vm_object_split(vm_map_entry_t entry) ("orig_object->charge < 0")); orig_object->charge -= ptoa(size); } + start = offidxstart; retry: - m = vm_page_find_least(orig_object, offidxstart); - for (; m != NULL && (idx = m->pindex - offidxstart) < size; - m = m_next) { - m_next = TAILQ_NEXT(m, listq); - - /* - * We must wait for pending I/O to complete before we can - * rename the page. - * - * We do not have to VM_PROT_NONE the page as mappings should - * not be changed by this operation. - */ - if ((m->oflags & VPO_BUSY) || m->busy) { - VM_OBJECT_UNLOCK(new_object); - m->oflags |= VPO_WANTED; - msleep(m, VM_OBJECT_MTX(orig_object), PVM, "spltwt", 0); - VM_OBJECT_LOCK(new_object); - goto retry; + while ((n = vm_radix_lookupn(&orig_object->rtree, start, + offidxstart + size, VM_RADIX_ANY, (void **)ma, VM_RADIX_STACK, + &start)) != 0) { + for (i = 0; i < n; i++) { + m = ma[i]; + idx = m->pindex - offidxstart; + if (m->flags & PG_CACHED) { + mtx_lock(&vm_page_queue_free_mtx); + if (m->object == orig_object) + vm_page_cache_rename(m, new_object, + idx); + mtx_unlock(&vm_page_queue_free_mtx); + continue; + } else if (m->object != orig_object) + continue; + /* + * We must wait for pending I/O to complete before + * we can rename the page. + * + * We do not have to VM_PROT_NONE the page as mappings + * should not be changed by this operation. + */ + if ((m->oflags & VPO_BUSY) || m->busy) { + start = m->pindex; + VM_OBJECT_UNLOCK(new_object); + m->oflags |= VPO_WANTED; + msleep(m, VM_OBJECT_MTX(orig_object), PVM, + "spltwt", 0); + VM_OBJECT_LOCK(new_object); + goto retry; + } + vm_page_lock(m); + vm_page_rename(m, new_object, idx); + vm_page_unlock(m); + /* + * page automatically made dirty by rename and + * cache handled + */ + vm_page_busy(m); } - vm_page_lock(m); - vm_page_rename(m, new_object, idx); - vm_page_unlock(m); - /* page automatically made dirty by rename and cache handled */ - vm_page_busy(m); + if (n < VM_RADIX_STACK) + break; } if (orig_object->type == OBJT_SWAP) { /* @@ -1323,13 +1370,6 @@ retry: * and new_object's locks are released and reacquired. */ swap_pager_copy(orig_object, new_object, offidxstart, 0); - - /* - * Transfer any cached pages from orig_object to new_object. - */ - if (__predict_false(orig_object->cache != NULL)) - vm_page_cache_transfer(orig_object, offidxstart, - new_object); } VM_OBJECT_UNLOCK(orig_object); TAILQ_FOREACH(m, &new_object->memq, listq) @@ -1348,10 +1388,13 @@ retry: static int vm_object_backing_scan(vm_object_t object, int op) { - int r = 1; + vm_page_t pa[VM_RADIX_STACK]; vm_page_t p; vm_object_t backing_object; - vm_pindex_t backing_offset_index; + vm_pindex_t backing_offset_index, new_pindex; + vm_pindex_t start; + int color, i, n; + int r = 1; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); VM_OBJECT_LOCK_ASSERT(object->backing_object, MA_OWNED); @@ -1379,15 +1422,39 @@ vm_object_backing_scan(vm_object_t objec if (op & OBSC_COLLAPSE_WAIT) { vm_object_set_flag(backing_object, OBJ_DEAD); } - + color = VM_RADIX_BLACK; + if (op & OBSC_COLLAPSE_WAIT) + color |= VM_RADIX_RED; /* * Our scan */ - p = TAILQ_FIRST(&backing_object->memq); - while (p) { - vm_page_t next = TAILQ_NEXT(p, listq); - vm_pindex_t new_pindex = p->pindex - backing_offset_index; +restart: + start = 0; + i = n = VM_RADIX_STACK; + for (;;) { + if (i == n) { + if (n < VM_RADIX_STACK) + break; + if ((n = vm_radix_lookupn(&backing_object->rtree, + start, 0, color, (void **)pa, VM_RADIX_STACK, + &start)) == 0) + break; + i = 0; + } + p = pa[i++]; + /* + * Free cached pages. XXX Why? Emulating old behavior here. + */ + if (p->flags & PG_CACHED) { + mtx_lock(&vm_page_queue_free_mtx); + if (p->object == backing_object) + vm_page_cache_free(p); + mtx_unlock(&vm_page_queue_free_mtx); + continue; + } else if (p->object != backing_object) + continue; + new_pindex = p->pindex - backing_offset_index; if (op & OBSC_TEST_ALL_SHADOWED) { vm_page_t pp; @@ -1399,13 +1466,9 @@ vm_object_backing_scan(vm_object_t objec * note that we do not busy the backing object's * page. */ - if ( - p->pindex < backing_offset_index || - new_pindex >= object->size - ) { - p = next; + if (p->pindex < backing_offset_index || + new_pindex >= object->size) continue; - } /* * See if the parent has the page or if the parent's @@ -1434,12 +1497,9 @@ vm_object_backing_scan(vm_object_t objec vm_page_t pp; if (op & OBSC_COLLAPSE_NOWAIT) { - if ((p->oflags & VPO_BUSY) || - !p->valid || - p->busy) { - p = next; + if ((p->oflags & VPO_BUSY) || !p->valid || + p->busy) continue; - } } else if (op & OBSC_COLLAPSE_WAIT) { if ((p->oflags & VPO_BUSY) || p->busy) { VM_OBJECT_UNLOCK(object); @@ -1455,8 +1515,7 @@ vm_object_backing_scan(vm_object_t objec * should not have changed so we * just restart our scan. */ - p = TAILQ_FIRST(&backing_object->memq); - continue; + goto restart; } } @@ -1492,7 +1551,6 @@ vm_object_backing_scan(vm_object_t objec else vm_page_remove(p); vm_page_unlock(p); - p = next; continue; } @@ -1512,7 +1570,6 @@ vm_object_backing_scan(vm_object_t objec * page before we can (re)lock the parent. * Hence we can get here. */ - p = next; continue; } if ( @@ -1534,7 +1591,6 @@ vm_object_backing_scan(vm_object_t objec else vm_page_remove(p); vm_page_unlock(p); - p = next; continue; } @@ -1558,7 +1614,6 @@ vm_object_backing_scan(vm_object_t objec vm_page_unlock(p); /* page automatically made dirty by rename */ } - p = next; } return (r); } @@ -1669,12 +1724,6 @@ vm_object_collapse(vm_object_t object) backing_object, object, OFF_TO_IDX(object->backing_object_offset), TRUE); - - /* - * Free any cached pages from backing_object. - */ - if (__predict_false(backing_object->cache != NULL)) - vm_page_cache_free(backing_object, 0, 0); } /* * Object now shadows whatever backing_object did. @@ -1795,75 +1844,101 @@ void vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int options) { - vm_page_t p, next; + struct vnode *vp; + vm_page_t pa[VM_RADIX_STACK]; + vm_page_t p; + int i, n; int wirings; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_PHYS) || (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); - if (object->resident_page_count == 0) - goto skipmemq; + if (object->resident_page_count == 0 && object->cached_page_count == 0) + return; + vp = NULL; vm_object_pip_add(object, 1); -again: - p = vm_page_find_least(object, start); - - /* - * Here, the variable "p" is either (1) the page with the least pindex - * greater than or equal to the parameter "start" or (2) NULL. - */ - for (; p != NULL && (p->pindex < end || end == 0); p = next) { - next = TAILQ_NEXT(p, listq); - - /* - * If the page is wired for any reason besides the existence - * of managed, wired mappings, then it cannot be freed. For - * example, fictitious pages, which represent device memory, - * are inherently wired and cannot be freed. They can, - * however, be invalidated if the option OBJPR_CLEANONLY is - * not specified. - */ - vm_page_lock(p); - if ((wirings = p->wire_count) != 0 && - (wirings = pmap_page_wired_mappings(p)) != p->wire_count) { +restart: + while ((n = vm_radix_lookupn(&object->rtree, start, end, VM_RADIX_ANY, + (void **)pa, VM_RADIX_STACK, &start)) != 0) { + for (i = 0; i < n; i++) { + p = pa[i]; + /* + * Another thread may allocate this cached page from + * the queue before we acquire the page queue free + * mtx. + */ + if (p->flags & PG_CACHED) { + mtx_lock(&vm_page_queue_free_mtx); + if (p->object == object) { + vm_page_cache_free(p); + if (object->type == OBJT_VNODE && + object->cached_page_count == 0) + vp = object->handle; + } + mtx_unlock(&vm_page_queue_free_mtx); + continue; + } else if (p->object != object) + continue; + /* + * If the page is wired for any reason besides + * the existence of managed, wired mappings, then + * it cannot be freed. For example, fictitious + * pages, which represent device memory, are + * inherently wired and cannot be freed. They can, + * however, be invalidated if the option + * OBJPR_CLEANONLY is not specified. + */ + vm_page_lock(p); + if ((wirings = p->wire_count) != 0 && + (wirings = pmap_page_wired_mappings(p)) != + p->wire_count) { + if ((options & OBJPR_NOTMAPPED) == 0) { + pmap_remove_all(p); + /* + * Account for removal of wired + * mappings. + */ + if (wirings != 0) + p->wire_count -= wirings; + } + if ((options & OBJPR_CLEANONLY) == 0) { + p->valid = 0; + vm_page_undirty(p); + } + vm_page_unlock(p); + continue; + } + if (vm_page_sleep_if_busy(p, TRUE, "vmopar")) { + start = 0; + goto restart; + } + KASSERT((p->flags & PG_FICTITIOUS) == 0, + ("vm_object_page_remove: page %p is fictitious", + p)); + if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) { + if ((options & OBJPR_NOTMAPPED) == 0) + pmap_remove_write(p); + if (p->dirty) { + vm_page_unlock(p); + continue; + } + } if ((options & OBJPR_NOTMAPPED) == 0) { pmap_remove_all(p); /* Account for removal of wired mappings. */ if (wirings != 0) p->wire_count -= wirings; } - if ((options & OBJPR_CLEANONLY) == 0) { - p->valid = 0; - vm_page_undirty(p); - } + vm_page_free(p); vm_page_unlock(p); - continue; - } - if (vm_page_sleep_if_busy(p, TRUE, "vmopar")) - goto again; - KASSERT((p->flags & PG_FICTITIOUS) == 0, - ("vm_object_page_remove: page %p is fictitious", p)); - if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) { - if ((options & OBJPR_NOTMAPPED) == 0) - pmap_remove_write(p); - if (p->dirty) { - vm_page_unlock(p); - continue; - } } - if ((options & OBJPR_NOTMAPPED) == 0) { - pmap_remove_all(p); - /* Account for removal of wired mappings. */ - if (wirings != 0) - p->wire_count -= wirings; - } - vm_page_free(p); - vm_page_unlock(p); + if (n < VM_RADIX_STACK) + break; } vm_object_pip_wakeup(object); -skipmemq: - if (__predict_false(object->cache != NULL)) - vm_page_cache_free(object, start, end); + if (vp) + vdrop(vp); } /* @@ -2188,8 +2263,9 @@ DB_SHOW_COMMAND(object, vm_object_print_ db_printf(","); count++; - db_printf("(off=0x%jx,page=0x%jx)", - (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p)); + db_printf("(off=0x%jx,page=0x%jx,obj=%p,flags=0x%X)", + (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p), + p->object, p->flags); } if (count != 0) db_printf("\n"); Modified: user/attilio/vmcontention/sys/vm/vm_object.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_object.h Sun Oct 30 08:35:19 2011 (r226929) +++ user/attilio/vmcontention/sys/vm/vm_object.h Sun Oct 30 11:11:04 2011 (r226930) @@ -90,7 +90,6 @@ struct vm_object { LIST_ENTRY(vm_object) shadow_list; /* chain of shadow objects */ TAILQ_HEAD(, vm_page) memq; /* list of resident pages */ struct vm_radix rtree; /* root of the resident page radix index tree */ - vm_page_t root; /* root of the resident page splay tree */ vm_pindex_t size; /* Object size */ int generation; /* generation ID */ int ref_count; /* How many refs?? */ @@ -101,11 +100,11 @@ struct vm_object { u_short pg_color; /* (c) color of first page in obj */ u_short paging_in_progress; /* Paging (in or out) so don't collapse or destroy */ int resident_page_count; /* number of resident pages */ + int cached_page_count; /* number of cached pages */ struct vm_object *backing_object; /* object that I'm a shadow of */ vm_ooffset_t backing_object_offset;/* Offset in backing object */ TAILQ_ENTRY(vm_object) pager_object_list; /* list of all objects of this pager type */ LIST_HEAD(, vm_reserv) rvq; /* list of reservations */ - vm_page_t cache; /* root of the cache page splay tree */ void *handle; union { /* Modified: user/attilio/vmcontention/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_page.c Sun Oct 30 08:35:19 2011 (r226929) +++ user/attilio/vmcontention/sys/vm/vm_page.c Sun Oct 30 11:11:04 2011 (r226930) @@ -764,63 +764,6 @@ vm_page_dirty(vm_page_t m) } /* - * vm_page_splay: - * - * Implements Sleator and Tarjan's top-down splay algorithm. Returns - * the vm_page containing the given pindex. If, however, that - * pindex is not found in the vm_object, returns a vm_page that is - * adjacent to the pindex, coming before or after it. - */ -vm_page_t -vm_page_splay(vm_pindex_t pindex, vm_page_t root) -{ - struct vm_page dummy; - vm_page_t lefttreemax, righttreemin, y; - - if (root == NULL) - return (root); - lefttreemax = righttreemin = &dummy; - for (;; root = y) { - if (pindex < root->pindex) { - if ((y = root->left) == NULL) - break; - if (pindex < y->pindex) { - /* Rotate right. */ - root->left = y->right; - y->right = root; - root = y; - if ((y = root->left) == NULL) - break; - } - /* Link into the new root's right tree. */ - righttreemin->left = root; - righttreemin = root; - } else if (pindex > root->pindex) { - if ((y = root->right) == NULL) - break; - if (pindex > y->pindex) { - /* Rotate left. */ - root->right = y->left; - y->left = root; - root = y; - if ((y = root->right) == NULL) - break; - } - /* Link into the new root's left tree. */ - lefttreemax->right = root; - lefttreemax = root; - } else - break; - } - /* Assemble the new root. */ - lefttreemax->right = root->left; - righttreemin->left = root->right; - root->left = dummy.right; - root->right = dummy.left; - return (root); -} - -/* * vm_page_insert: [ internal use only ] * * Inserts the given mem entry into the object and object list. @@ -836,11 +779,7 @@ vm_page_splay(vm_pindex_t pindex, vm_pag void vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex) { -#ifdef VM_RADIX vm_page_t neighbor; -#else - vm_page_t root; -#endif VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); if (m->object != NULL) panic("vm_page_insert: page already inserted"); @@ -851,11 +790,11 @@ vm_page_insert(vm_page_t m, vm_object_t m->object = object; m->pindex = pindex; -#ifdef VM_RADIX if (object->resident_page_count == 0) { TAILQ_INSERT_TAIL(&object->memq, m, listq); } else { - neighbor = vm_radix_lookup_ge(&object->rtree, pindex); + neighbor = vm_radix_lookup_ge(&object->rtree, pindex, + VM_RADIX_BLACK); if (neighbor != NULL) { KASSERT(pindex != neighbor->pindex, ("vm_page_insert: offset already allocated")); @@ -865,33 +804,6 @@ vm_page_insert(vm_page_t m, vm_object_t } if (vm_radix_insert(&object->rtree, pindex, m) != 0) panic("vm_page_insert: unable to insert the new page"); -#else - /* - * Now link into the object's ordered list of backed pages. - */ - root = object->root; - if (root == NULL) { - m->left = NULL; - m->right = NULL; - TAILQ_INSERT_TAIL(&object->memq, m, listq); - } else { - root = vm_page_splay(pindex, root); - if (pindex < root->pindex) { - m->left = root->left; - m->right = root; - root->left = NULL; - TAILQ_INSERT_BEFORE(root, m, listq); - } else if (pindex == root->pindex) - panic("vm_page_insert: offset already allocated"); - else { - m->right = root->right; - m->left = root; - root->right = NULL; - TAILQ_INSERT_AFTER(&object->memq, root, m, listq); - } - } - object->root = m; -#endif /* * show that the object has one more resident page. @@ -927,9 +839,6 @@ void vm_page_remove(vm_page_t m) { vm_object_t object; -#ifndef VM_RADIX - vm_page_t next, prev, root; -#endif if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_lock_assert(m, MA_OWNED); @@ -941,50 +850,7 @@ vm_page_remove(vm_page_t m) vm_page_flash(m); } -#ifdef VM_RADIX - vm_radix_remove(&object->rtree, m->pindex); -#else - /* - * Now remove from the object's list of backed pages. - */ - if ((next = TAILQ_NEXT(m, listq)) != NULL && next->left == m) { - /* - * Since the page's successor in the list is also its parent - * in the tree, its right subtree must be empty. - */ - next->left = m->left; - KASSERT(m->right == NULL, - ("vm_page_remove: page %p has right child", m)); - } else if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && - prev->right == m) { - /* - * Since the page's predecessor in the list is also its parent - * in the tree, its left subtree must be empty. - */ - KASSERT(m->left == NULL, - ("vm_page_remove: page %p has left child", m)); - prev->right = m->right; - } else { - if (m != object->root) - vm_page_splay(m->pindex, object->root); - if (m->left == NULL) - root = m->right; - else if (m->right == NULL) - root = m->left; - else { - /* - * Move the page's successor to the root, because - * pages are usually removed in ascending order. - */ - if (m->right != next) - vm_page_splay(m->pindex, m->right); - next->left = m->left; - root = next; - } - object->root = root; - } -#endif - + vm_radix_remove(&object->rtree, m->pindex, VM_RADIX_BLACK); TAILQ_REMOVE(&object->memq, m, listq); /* @@ -1013,20 +879,10 @@ vm_page_remove(vm_page_t m) vm_page_t vm_page_lookup(vm_object_t object, vm_pindex_t pindex) { - vm_page_t m; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); -#ifdef VM_RADIX - m = vm_radix_lookup(&object->rtree, pindex); -#else - if ((m = object->root) != NULL && m->pindex != pindex) { - m = vm_page_splay(pindex, m); - if ((object->root = m)->pindex != pindex) - m = NULL; - } -#endif - return (m); + return vm_radix_lookup(&object->rtree, pindex, VM_RADIX_BLACK); } /* @@ -1041,22 +897,12 @@ vm_page_lookup(vm_object_t object, vm_pi vm_page_t vm_page_find_least(vm_object_t object, vm_pindex_t pindex) { - vm_page_t m; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); -#ifdef VM_RADIX - if ((m = TAILQ_FIRST(&object->memq)) != NULL) - m = vm_radix_lookup_ge(&object->rtree, pindex); -#else - if ((m = TAILQ_FIRST(&object->memq)) != NULL) { - if (m->pindex < pindex) { - m = vm_page_splay(pindex, object->root); - if ((object->root = m)->pindex < pindex) - m = TAILQ_NEXT(m, listq); - } - } -#endif - return (m); + if (object->resident_page_count) + return vm_radix_lookup_ge(&object->rtree, pindex, + VM_RADIX_BLACK); + return (NULL); } /* @@ -1126,71 +972,6 @@ vm_page_rename(vm_page_t m, vm_object_t } /* - * Convert all of the given object's cached pages that have a - * pindex within the given range into free pages. If the value - * zero is given for "end", then the range's upper bound is - * infinity. If the given object is backed by a vnode and it - * transitions from having one or more cached pages to none, the - * vnode's hold count is reduced. - */ -void -vm_page_cache_free(vm_object_t object, vm_pindex_t start, vm_pindex_t end) -{ - vm_page_t m, m_next; - boolean_t empty; - - mtx_lock(&vm_page_queue_free_mtx); - if (__predict_false(object->cache == NULL)) { - mtx_unlock(&vm_page_queue_free_mtx); - return; - } - m = object->cache = vm_page_splay(start, object->cache); - if (m->pindex < start) { - if (m->right == NULL) - m = NULL; - else { - m_next = vm_page_splay(start, m->right); - m_next->left = m; - m->right = NULL; - m = object->cache = m_next; - } - } - - /* - * At this point, "m" is either (1) a reference to the page - * with the least pindex that is greater than or equal to - * "start" or (2) NULL. - */ - for (; m != NULL && (m->pindex < end || end == 0); m = m_next) { - /* - * Find "m"'s successor and remove "m" from the - * object's cache. - */ - if (m->right == NULL) { - object->cache = m->left; - m_next = NULL; - } else { - m_next = vm_page_splay(start, m->right); - m_next->left = m->left; - object->cache = m_next; - } - /* Convert "m" to a free page. */ - m->object = NULL; - m->valid = 0; - /* Clear PG_CACHED and set PG_FREE. */ - m->flags ^= PG_CACHED | PG_FREE; - KASSERT((m->flags & (PG_CACHED | PG_FREE)) == PG_FREE, - ("vm_page_cache_free: page %p has inconsistent flags", m)); - cnt.v_cache_count--; - cnt.v_free_count++; - } - empty = object->cache == NULL; - mtx_unlock(&vm_page_queue_free_mtx); - if (object->type == OBJT_VNODE && empty) - vdrop(object->handle); -} - -/* * Returns the cached page that is associated with the given * object and offset. If, however, none exists, returns NULL. * @@ -1199,15 +980,12 @@ vm_page_cache_free(vm_object_t object, v static inline vm_page_t vm_page_cache_lookup(vm_object_t object, vm_pindex_t pindex) { - vm_page_t m; + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - if ((m = object->cache) != NULL && m->pindex != pindex) { - m = vm_page_splay(pindex, m); - if ((object->cache = m)->pindex != pindex) - m = NULL; - } - return (m); + if (object->cached_page_count != 0) + return vm_radix_lookup(&object->rtree, pindex, VM_RADIX_RED); + return (NULL); } /* @@ -1219,104 +997,77 @@ vm_page_cache_lookup(vm_object_t object, void vm_page_cache_remove(vm_page_t m) { - vm_object_t object; - vm_page_t root; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT((m->flags & PG_CACHED) != 0, ("vm_page_cache_remove: page %p is not cached", m)); - object = m->object; - if (m != object->cache) { - root = vm_page_splay(m->pindex, object->cache); - KASSERT(root == m, - ("vm_page_cache_remove: page %p is not cached in object %p", - m, object)); - } - if (m->left == NULL) - root = m->right; - else if (m->right == NULL) - root = m->left; - else { - root = vm_page_splay(m->pindex, m->left); - root->right = m->right; - } - object->cache = root; + vm_radix_remove(&m->object->rtree, m->pindex, VM_RADIX_RED); + m->object->cached_page_count--; m->object = NULL; cnt.v_cache_count--; } /* - * Transfer all of the cached pages with offset greater than or - * equal to 'offidxstart' from the original object's cache to the - * new object's cache. However, any cached pages with offset - * greater than or equal to the new object's size are kept in the - * original object. Initially, the new object's cache must be - * empty. Offset 'offidxstart' in the original object must - * correspond to offset zero in the new object. + * Move a given cached page from an object's cached pages to + * the free list. * - * The new object must be locked. + * The free page queue mtx and object lock must be locked. */ void -vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart, - vm_object_t new_object) +vm_page_cache_free(vm_page_t m) { - vm_page_t m, m_next; + vm_object_t object; + + object = m->object; + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + KASSERT((m->flags & PG_CACHED) != 0, + ("vm_page_cache_free: page %p is not cached", m)); /* - * Insertion into an object's collection of cached pages - * requires the object to be locked. In contrast, removal does - * not. + * Replicate vm_page_cache_remove with a version that can collapse + * internal nodes since the object lock is held. */ + vm_radix_remove(&object->rtree, m->pindex, VM_RADIX_ANY); + object->cached_page_count--; + m->object = NULL; + m->valid = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 11:25:45 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351161065678; Sun, 30 Oct 2011 11:25:45 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25C218FC08; Sun, 30 Oct 2011 11:25:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UBPjIE066075; Sun, 30 Oct 2011 11:25:45 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UBPj7V066073; Sun, 30 Oct 2011 11:25:45 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201110301125.p9UBPj7V066073@svn.freebsd.org> From: Attilio Rao Date: Sun, 30 Oct 2011 11:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226931 - user/attilio/vmcontention/sys/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:25:45 -0000 Author: attilio Date: Sun Oct 30 11:25:44 2011 New Revision: 226931 URL: http://svn.freebsd.org/changeset/base/226931 Log: Remove VM_RADIX option now that is unused. Modified: user/attilio/vmcontention/sys/conf/options Modified: user/attilio/vmcontention/sys/conf/options ============================================================================== --- user/attilio/vmcontention/sys/conf/options Sun Oct 30 11:11:04 2011 (r226930) +++ user/attilio/vmcontention/sys/conf/options Sun Oct 30 11:25:44 2011 (r226931) @@ -591,7 +591,6 @@ VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h -VM_RADIX opt_vm.h NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h MALLOC_PROFILE opt_vm.h From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 11:43:15 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4324F1065674; Sun, 30 Oct 2011 11:43:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FE0A8FC08; Sun, 30 Oct 2011 11:43:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UBhFar066662; Sun, 30 Oct 2011 11:43:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UBhDZd066634; Sun, 30 Oct 2011 11:43:13 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201110301143.p9UBhDZd066634@svn.freebsd.org> From: Attilio Rao Date: Sun, 30 Oct 2011 11:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226932 - in user/attilio/vmcontention: contrib/top etc/rc.d games/fortune/datfiles sbin/fdisk share/mk sys/dev/ath sys/dev/mfi sys/dev/syscons sys/dev/tws sys/dev/usb sys/geom/part sys... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 11:43:15 -0000 Author: attilio Date: Sun Oct 30 11:43:12 2011 New Revision: 226932 URL: http://svn.freebsd.org/changeset/base/226932 Log: MFC Added: user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0 - copied unchanged from r226931, head/tools/regression/bin/sh/builtins/for1.0 Modified: user/attilio/vmcontention/etc/rc.d/dhclient user/attilio/vmcontention/games/fortune/datfiles/fortunes user/attilio/vmcontention/sbin/fdisk/fdisk.c user/attilio/vmcontention/sys/dev/ath/if_ath.c user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h user/attilio/vmcontention/sys/dev/mfi/mfivar.h user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c user/attilio/vmcontention/sys/dev/tws/tws_services.c user/attilio/vmcontention/sys/dev/tws/tws_services.h user/attilio/vmcontention/sys/dev/usb/usb_device.c user/attilio/vmcontention/sys/dev/usb/usb_msctest.c user/attilio/vmcontention/sys/geom/part/g_part.c user/attilio/vmcontention/sys/kern/kern_sig.c user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c user/attilio/vmcontention/sys/vm/vm_contig.c user/attilio/vmcontention/sys/vm/vm_extern.h user/attilio/vmcontention/sys/vm/vm_phys.c user/attilio/vmcontention/sys/vm/vm_phys.h user/attilio/vmcontention/sys/vm/vm_reserv.c user/attilio/vmcontention/sys/vm/vm_reserv.h user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd user/attilio/vmcontention/usr.bin/sed/sed.1 user/attilio/vmcontention/usr.bin/who/who.1 user/attilio/vmcontention/usr.bin/who/who.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/bind9/ (props changed) user/attilio/vmcontention/contrib/binutils/ (props changed) user/attilio/vmcontention/contrib/bzip2/ (props changed) user/attilio/vmcontention/contrib/com_err/ (props changed) user/attilio/vmcontention/contrib/compiler-rt/ (props changed) user/attilio/vmcontention/contrib/dialog/ (props changed) user/attilio/vmcontention/contrib/ee/ (props changed) user/attilio/vmcontention/contrib/expat/ (props changed) user/attilio/vmcontention/contrib/file/ (props changed) user/attilio/vmcontention/contrib/gcc/ (props changed) user/attilio/vmcontention/contrib/gdb/ (props changed) user/attilio/vmcontention/contrib/gdtoa/ (props changed) user/attilio/vmcontention/contrib/gnu-sort/ (props changed) user/attilio/vmcontention/contrib/groff/ (props changed) user/attilio/vmcontention/contrib/less/ (props changed) user/attilio/vmcontention/contrib/libpcap/ (props changed) user/attilio/vmcontention/contrib/libstdc++/ (props changed) user/attilio/vmcontention/contrib/llvm/ (props changed) user/attilio/vmcontention/contrib/llvm/tools/clang/ (props changed) user/attilio/vmcontention/contrib/ncurses/ (props changed) user/attilio/vmcontention/contrib/netcat/ (props changed) user/attilio/vmcontention/contrib/ntp/ (props changed) user/attilio/vmcontention/contrib/one-true-awk/ (props changed) user/attilio/vmcontention/contrib/openbsm/ (props changed) user/attilio/vmcontention/contrib/openpam/ (props changed) user/attilio/vmcontention/contrib/openresolv/ (props changed) user/attilio/vmcontention/contrib/pf/ (props changed) user/attilio/vmcontention/contrib/sendmail/ (props changed) user/attilio/vmcontention/contrib/tcpdump/ (props changed) user/attilio/vmcontention/contrib/tcsh/ (props changed) user/attilio/vmcontention/contrib/tnftp/ (props changed) user/attilio/vmcontention/contrib/top/ (props changed) user/attilio/vmcontention/contrib/top/install-sh (props changed) user/attilio/vmcontention/contrib/tzcode/stdtime/ (props changed) user/attilio/vmcontention/contrib/tzcode/zic/ (props changed) user/attilio/vmcontention/contrib/tzdata/ (props changed) user/attilio/vmcontention/contrib/wpa/ (props changed) user/attilio/vmcontention/contrib/xz/ (props changed) user/attilio/vmcontention/crypto/heimdal/ (props changed) user/attilio/vmcontention/crypto/openssh/ (props changed) user/attilio/vmcontention/crypto/openssl/ (props changed) user/attilio/vmcontention/gnu/lib/ (props changed) user/attilio/vmcontention/gnu/usr.bin/binutils/ (props changed) user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/ (props changed) user/attilio/vmcontention/gnu/usr.bin/gdb/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libc/stdtime/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/lib/libz/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/mk/bsd.arch.inc.mk (props changed) user/attilio/vmcontention/share/zoneinfo/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/amd64/include/xen/ (props changed) user/attilio/vmcontention/sys/boot/ (props changed) user/attilio/vmcontention/sys/boot/i386/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/ski/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/ofw/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/ (props changed) user/attilio/vmcontention/sys/contrib/octeon-sdk/ (props changed) user/attilio/vmcontention/sys/contrib/pf/ (props changed) user/attilio/vmcontention/sys/contrib/x86emu/ (props changed) user/attilio/vmcontention/usr.bin/calendar/ (props changed) user/attilio/vmcontention/usr.bin/csup/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) user/attilio/vmcontention/usr.sbin/ndiscvt/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvctl/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvd/ (props changed) user/attilio/vmcontention/usr.sbin/rtsold/ (props changed) user/attilio/vmcontention/usr.sbin/zic/ (props changed) Modified: user/attilio/vmcontention/etc/rc.d/dhclient ============================================================================== --- user/attilio/vmcontention/etc/rc.d/dhclient Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/etc/rc.d/dhclient Sun Oct 30 11:43:12 2011 (r226932) @@ -15,9 +15,21 @@ name="dhclient" rcvar= pidfile="/var/run/${name}.${ifn}.pid" start_precmd="dhclient_prestart" +stop_precmd="dhclient_pre_check" + +# rc_force check can only be done at the run_rc_command +# time, so we're testing it in the pre* hooks. +dhclient_pre_check() +{ + if [ -z "${rc_force}" ] && ! dhcpif $ifn; then + err 1 "'$ifn' is not a DHCP-enabled interface" + fi +} dhclient_prestart() { + dhclient_pre_check + # Interface-specific flags (see rc.subr for $flags setting) specific=$(get_if_var $ifn dhclient_flags_IF) if [ -z "$flags" -a -n "$specific" ]; then @@ -38,11 +50,8 @@ load_rc_config network if [ -z $ifn ] ; then # only complain if a command was specified but no interface if [ -n "$1" ] ; then - echo 1>&2 "$0: no interface specified" - return 1 + err 1 "$0: no interface specified" fi -elif [ -z "${rc_force}" ] && ! dhcpif $ifn; then - return 1 fi run_rc_command "$1" Modified: user/attilio/vmcontention/games/fortune/datfiles/fortunes ============================================================================== --- user/attilio/vmcontention/games/fortune/datfiles/fortunes Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/games/fortune/datfiles/fortunes Sun Oct 30 11:43:12 2011 (r226932) @@ -4942,25 +4942,37 @@ cats on the dinette table, etc. "That stop him?" "No, but it sure slowed him up." % - Youth is not a time of life, it is a state of mind; it is a temper of -the will, a quality of the imagination, a vigor of the emotions, a predominance -of courage over timidity, of the appetite for adventure over love of ease. - Nobody grows old by merely living a number of years; people grow -old only by deserting their ideals. Years wrinkle the skin, but to give up -enthusiasm wrinkles the soul. Worry, doubt, self-distrust, fear, and despair --- these are the long, long years that bow the head and turn the growing spirit -back to dust. - Whether seventy or sixteen, there is in every being's heart the love -of wonder, the sweet amazement at the stars and the starlike things and -thoughts, the undaunted challenge of events, the unfailing childlike appetite -for what next, and the joy and the game of life. - You are as young as your faith, as old as your doubt; as young as your -self-confidence, as old as your fear, as young as your hope, as old as your -despair. - So long as your heart receives messages of beauty, cheer, courage, -grandeur and power from the earth, from man, and from the Infinite, so long -you are young. - -- Samuel Ullman + Youth is not a time of life--it is a state of mind. It is not a +matter of red cheeks, red lips and supple knees. It is a temper of the +will; a quality of the imagination; a vigor of the emotions; it is a +freshness of the deep springs of life. Youth means a tempermental +predominance of courage over timidity, of the appetite for adventure +over a life of ease. This often exists in a man of fifty, more than in +a boy of twenty. Nobody grows old by merely living a number of years; +people grow old by deserting their ideals. + + Years may wrinkle the skin, but to give up enthusiasm wrinkles +the soul. Worry, doubt, self-distrust, fear and despair--these are the +long, long years that bow the head and turn the growing spirit back to +dust. + + Whether seventy or sixteen, there is in every being’s heart a +love of wonder; the sweet amazement at the stars and starlike things and +thoughts; the undaunted challenge of events, the unfailing childlike +appetite for what comes next, and the joy in the game of life. + + You are as young as your faith, as old as your doubt; as young +as your self-confidence, as old as your fear, as young as your hope, as +old as your despair. + + In the central place of your heart there is a wireless station. +So long as it receives messages of beauty, hope, cheer, grandeur, +courage, and power from the earth, from men and from the Infinite--so +long are you young. When the wires are all down and the central places +of your heart are covered with the snows of pessimism and the ice of +cynicism, then are you grown old, indeed! + -- Samuel Ullman, "Youth" (1934), as published in + The Silver Treasury, Prose and Verse for Every Mood % " " -- Charlie Chaplin Modified: user/attilio/vmcontention/sbin/fdisk/fdisk.c ============================================================================== --- user/attilio/vmcontention/sbin/fdisk/fdisk.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sbin/fdisk/fdisk.c Sun Oct 30 11:43:12 2011 (r226932) @@ -487,7 +487,7 @@ print_part(const struct dos_partition *p get_type(partp->dp_typ)); printf(" start %lu, size %lu (%ju Meg), flag %x%s\n", (u_long)partp->dp_start, - (u_long)partp->dp_size, + (u_long)partp->dp_size, (uintmax_t)part_mb, partp->dp_flag, partp->dp_flag == ACTIVE ? " (active)" : ""); @@ -513,6 +513,8 @@ init_boot(void) if ((fdesc = open(fname, O_RDONLY)) == -1 || fstat(fdesc, &sb) == -1) err(1, "%s", fname); + if (sb.st_size == 0) + errx(1, "%s is empty, must not be.", fname); if ((mboot.bootinst_size = sb.st_size) % secsize != 0) errx(1, "%s: length must be a multiple of sector size", fname); if (mboot.bootinst != NULL) @@ -890,7 +892,7 @@ write_s0() dos_partition_enc(&mboot.bootinst[DOSPARTOFF + i * DOSPARTSIZE], &mboot.parts[i]); le16enc(&mboot.bootinst[DOSMAGICOFFSET], DOSMAGIC); - for(sector = 0; sector < mboot.bootinst_size / secsize; sector++) + for(sector = 0; sector < mboot.bootinst_size / secsize; sector++) if (write_disk(sector, &mboot.bootinst[sector * secsize]) == -1) { warn("can't write fdisk partition table"); @@ -1111,7 +1113,7 @@ str2sectors(const char *str) return NO_DISK_SECTORS; } - if (*end == 'K') + if (*end == 'K') val *= 1024UL / secsize; else if (*end == 'M') val *= 1024UL * 1024UL / secsize; Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/if_ath.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/ath/if_ath.c Sun Oct 30 11:43:12 2011 (r226932) @@ -3624,8 +3624,10 @@ rx_error: /* NB: bpf needs the mbuf length setup */ len = rs->rs_datalen; m->m_pkthdr.len = m->m_len = len; + bf->bf_m = NULL; ath_rx_tap(ifp, m, rs, tsf, nf); ieee80211_radiotap_rx_all(ic, m); + m_freem(m); } /* XXX pass MIC errors up for s/w reclaculation */ goto rx_next; Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h Sun Oct 30 11:43:12 2011 (r226932) @@ -57,6 +57,11 @@ enum { ATH_DEBUG_TDMA = 0x00800000, /* TDMA processing */ ATH_DEBUG_TDMA_TIMER = 0x01000000, /* TDMA timer processing */ ATH_DEBUG_REGDOMAIN = 0x02000000, /* regulatory processing */ + ATH_DEBUG_SW_TX = 0x04000000, /* per-packet software TX */ + ATH_DEBUG_SW_TX_BAW = 0x08000000, /* BAW handling */ + ATH_DEBUG_SW_TX_CTRL = 0x10000000, /* queue control */ + ATH_DEBUG_SW_TX_AGGR = 0x20000000, /* aggregate TX */ + ATH_DEBUG_SW_TX_RETRIES = 0x40000000, /* software TX retries */ ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ ATH_DEBUG_ANY = 0xffffffff }; Modified: user/attilio/vmcontention/sys/dev/mfi/mfivar.h ============================================================================== --- user/attilio/vmcontention/sys/dev/mfi/mfivar.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/mfi/mfivar.h Sun Oct 30 11:43:12 2011 (r226932) @@ -352,12 +352,29 @@ mfi_dequeue_bio(struct mfi_softc *sc) return (bp); } +/* + * This is from the original scsi_extract_sense() in CAM. It's copied + * here because CAM now uses a non-inline version that follows more complex + * additions to the SPC spec, and we don't want to force a dependency on + * the CAM module for such a trivial action. + */ +static __inline void +mfi_extract_sense(struct scsi_sense_data_fixed *sense, + int *error_code, int *sense_key, int *asc, int *ascq) +{ + + *error_code = sense->error_code & SSD_ERRCODE; + *sense_key = sense->flags & SSD_KEY; + *asc = (sense->extra_len >= 5) ? sense->add_sense_code : 0; + *ascq = (sense->extra_len >= 6) ? sense->add_sense_code_qual : 0; +} + static __inline void mfi_print_sense(struct mfi_softc *sc, void *sense) { int error, key, asc, ascq; - scsi_extract_sense((struct scsi_sense_data *)sense, + mfi_extract_sense((struct scsi_sense_data_fixed *)sense, &error, &key, &asc, &ascq); device_printf(sc->mfi_dev, "sense error %d, sense_key %d, " "asc %d, ascq %d\n", error, key, asc, ascq); Modified: user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c ============================================================================== --- user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c Sun Oct 30 11:43:12 2011 (r226932) @@ -424,10 +424,18 @@ static const struct unicp437 cp437table[ { 0x00b6, 0x14, 0x00 }, { 0x00b7, 0xfa, 0x00 }, { 0x00ba, 0xa7, 0x00 }, { 0x00bb, 0xaf, 0x00 }, { 0x00bc, 0xac, 0x00 }, { 0x00bd, 0xab, 0x00 }, - { 0x00bf, 0xa8, 0x00 }, { 0x00c4, 0x8e, 0x01 }, - { 0x00c6, 0x92, 0x00 }, { 0x00c7, 0x80, 0x00 }, - { 0x00c9, 0x90, 0x00 }, { 0x00d1, 0xa5, 0x00 }, - { 0x00d6, 0x99, 0x00 }, { 0x00dc, 0x9a, 0x00 }, + { 0x00bf, 0xa8, 0x00 }, { 0x00c0, 0x41, 0x00 }, + { 0x00c1, 0x41, 0x00 }, { 0x00c2, 0x41, 0x00 }, + { 0x00c4, 0x8e, 0x01 }, { 0x00c6, 0x92, 0x00 }, + { 0x00c7, 0x80, 0x00 }, { 0x00c8, 0x45, 0x00 }, + { 0x00c9, 0x90, 0x00 }, { 0x00ca, 0x45, 0x00 }, + { 0x00cb, 0x45, 0x00 }, { 0x00cc, 0x49, 0x00 }, + { 0x00cd, 0x49, 0x00 }, { 0x00ce, 0x49, 0x00 }, + { 0x00cf, 0x49, 0x00 }, { 0x00d1, 0xa5, 0x00 }, + { 0x00d2, 0x4f, 0x00 }, { 0x00d3, 0x4f, 0x00 }, + { 0x00d4, 0x4f, 0x00 }, { 0x00d6, 0x99, 0x00 }, + { 0x00d9, 0x55, 0x00 }, { 0x00da, 0x55, 0x00 }, + { 0x00db, 0x55, 0x00 }, { 0x00dc, 0x9a, 0x00 }, { 0x00df, 0xe1, 0x00 }, { 0x00e0, 0x85, 0x00 }, { 0x00e1, 0xa0, 0x00 }, { 0x00e2, 0x83, 0x00 }, { 0x00e4, 0x84, 0x00 }, { 0x00e5, 0x86, 0x00 }, @@ -442,6 +450,7 @@ static const struct unicp437 cp437table[ { 0x00f8, 0xed, 0x00 }, { 0x00f9, 0x97, 0x00 }, { 0x00fa, 0xa3, 0x00 }, { 0x00fb, 0x96, 0x00 }, { 0x00fc, 0x81, 0x00 }, { 0x00ff, 0x98, 0x00 }, + { 0x013f, 0x4c, 0x00 }, { 0x0140, 0x6c, 0x00 }, { 0x0192, 0x9f, 0x00 }, { 0x0393, 0xe2, 0x00 }, { 0x0398, 0xe9, 0x00 }, { 0x03a3, 0xe4, 0x00 }, { 0x03a6, 0xe8, 0x00 }, { 0x03a9, 0xea, 0x00 }, @@ -490,7 +499,8 @@ static const struct unicp437 cp437table[ { 0x2584, 0xdc, 0x00 }, { 0x2588, 0xdb, 0x00 }, { 0x258c, 0xdd, 0x00 }, { 0x2590, 0xde, 0x00 }, { 0x2591, 0xb0, 0x02 }, { 0x25a0, 0xfe, 0x00 }, - { 0x25ac, 0x16, 0x00 }, { 0x25b2, 0x1e, 0x00 }, + { 0x25ac, 0x16, 0x00 }, + { 0x25ae, 0xdb, 0x00 }, { 0x25b2, 0x1e, 0x00 }, { 0x25ba, 0x10, 0x00 }, { 0x25bc, 0x1f, 0x00 }, { 0x25c4, 0x11, 0x00 }, { 0x25cb, 0x09, 0x00 }, { 0x25d8, 0x08, 0x00 }, { 0x25d9, 0x0a, 0x00 }, Modified: user/attilio/vmcontention/sys/dev/tws/tws_services.c ============================================================================== --- user/attilio/vmcontention/sys/dev/tws/tws_services.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/tws/tws_services.c Sun Oct 30 11:43:12 2011 (r226932) @@ -53,7 +53,7 @@ struct tws_sense *tws_find_sense_from_mf -struct error_desc array[] = { +static struct error_desc array[] = { { "Cannot add sysctl tree node", 0x2000, ERROR, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, { "Register window not available", 0x2001, ERROR, Modified: user/attilio/vmcontention/sys/dev/tws/tws_services.h ============================================================================== --- user/attilio/vmcontention/sys/dev/tws/tws_services.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/tws/tws_services.h Sun Oct 30 11:43:12 2011 (r226932) @@ -114,7 +114,6 @@ struct error_desc { char *error_str; }; -extern struct error_desc array[]; /* ----------- q services ------------- */ #define TWS_FREE_Q 0 Modified: user/attilio/vmcontention/sys/dev/usb/usb_device.c ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usb_device.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/usb/usb_device.c Sun Oct 30 11:43:12 2011 (r226932) @@ -1851,7 +1851,8 @@ repeat_set_config: } } if (set_config_failed == 0 && config_index == 0 && - usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0) { + usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 && + usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0) { /* * Try to figure out if there are any MSC quirks we Modified: user/attilio/vmcontention/sys/dev/usb/usb_msctest.c ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usb_msctest.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/dev/usb/usb_msctest.c Sun Oct 30 11:43:12 2011 (r226932) @@ -603,6 +603,29 @@ usb_iface_is_cdrom(struct usb_device *ud return (is_cdrom); } +static uint8_t +usb_msc_get_max_lun(struct usb_device *udev, uint8_t iface_index) +{ + struct usb_device_request req; + usb_error_t err; + uint8_t buf = 0; + + + /* The Get Max Lun command is a class-specific request. */ + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = 0xFE; /* GET_MAX_LUN */ + USETW(req.wValue, 0); + req.wIndex[0] = iface_index; + req.wIndex[1] = 0; + USETW(req.wLength, 1); + + err = usbd_do_request(udev, NULL, &req, &buf); + if (err) + buf = 0; + + return (buf); +} + usb_error_t usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index) { @@ -622,6 +645,11 @@ usb_msc_auto_quirk(struct usb_device *ud */ usb_pause_mtx(NULL, hz); + if (usb_msc_get_max_lun(udev, iface_index) == 0) { + DPRINTF("Device has only got one LUN.\n"); + usbd_add_dynamic_quirk(udev, UQ_MSC_NO_GETMAXLUN); + } + is_no_direct = 1; for (timeout = 4; timeout; timeout--) { err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, Modified: user/attilio/vmcontention/sys/geom/part/g_part.c ============================================================================== --- user/attilio/vmcontention/sys/geom/part/g_part.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/geom/part/g_part.c Sun Oct 30 11:43:12 2011 (r226932) @@ -451,6 +451,10 @@ g_part_parm_geom(struct gctl_req *req, c gctl_error(req, "%d %s '%s'", EINVAL, name, gname); return (EINVAL); } + if ((gp->flags & G_GEOM_WITHER) != 0) { + gctl_error(req, "%d %s", ENXIO, gname); + return (ENXIO); + } *v = gp; return (0); } Modified: user/attilio/vmcontention/sys/kern/kern_sig.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_sig.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/kern/kern_sig.c Sun Oct 30 11:43:12 2011 (r226932) @@ -2058,7 +2058,7 @@ tdsendsignal(struct proc *p, struct thre */ mtx_lock(&ps->ps_mtx); if (SIGISMEMBER(ps->ps_sigignore, sig)) { - SDT_PROBE(proc, kernel, , signal_discard, ps, td, sig, 0, 0 ); + SDT_PROBE(proc, kernel, , signal_discard, td, p, sig, 0, 0 ); mtx_unlock(&ps->ps_mtx); if (ksi && (ksi->ksi_flags & KSI_INS)) Modified: user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c ============================================================================== --- user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c Sun Oct 30 11:43:12 2011 (r226932) @@ -571,8 +571,8 @@ ieee80211_notify_replay_failure(struct i struct ifnet *ifp = vap->iv_ifp; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, - "%s replay detected ", - k->wk_cipher->ic_name, (intmax_t) rsc, + "%s replay detected tid %d ", + tid, k->wk_cipher->ic_name, (intmax_t) rsc, (intmax_t) k->wk_keyrsc[tid], k->wk_keyix, k->wk_rxkeyix); Modified: user/attilio/vmcontention/sys/vm/vm_contig.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_contig.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_contig.c Sun Oct 30 11:43:12 2011 (r226932) @@ -335,12 +335,12 @@ contigmapping(vm_map_t map, vm_size_t si vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, unsigned long alignment, unsigned long boundary, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { vm_offset_t ret; vm_page_t pages; - unsigned long npgs; + u_long npgs; int tries; size = round_page(size); Modified: user/attilio/vmcontention/sys/vm/vm_extern.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_extern.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_extern.h Sun Oct 30 11:43:12 2011 (r226932) @@ -44,8 +44,8 @@ vm_offset_t kmem_alloc(vm_map_t, vm_size vm_offset_t kmem_alloc_attr(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, unsigned long alignment, - unsigned long boundary, vm_memattr_t memattr); + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); vm_offset_t kmem_alloc_nofault_space(vm_map_t, vm_size_t, int); vm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t); Modified: user/attilio/vmcontention/sys/vm/vm_phys.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_phys.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_phys.c Sun Oct 30 11:43:12 2011 (r226932) @@ -490,26 +490,6 @@ vm_phys_alloc_freelist_pages(int flind, } /* - * Allocate physical memory from phys_avail[]. - */ -vm_paddr_t -vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment) -{ - vm_paddr_t pa; - int i; - - size = round_page(size); - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (phys_avail[i + 1] - phys_avail[i] < size) - continue; - pa = phys_avail[i]; - phys_avail[i] += size; - return (pa); - } - panic("vm_phys_bootstrap_alloc"); -} - -/* * Find the vm_page corresponding to the given physical address. */ vm_page_t @@ -554,7 +534,7 @@ vm_phys_free_pages(vm_page_t m, int orde { struct vm_freelist *fl; struct vm_phys_seg *seg; - vm_paddr_t pa, pa_buddy; + vm_paddr_t pa; vm_page_t m_buddy; KASSERT(m->order == VM_NFREEORDER, @@ -566,25 +546,26 @@ vm_phys_free_pages(vm_page_t m, int orde KASSERT(order < VM_NFREEORDER, ("vm_phys_free_pages: order %d is out of range", order)); mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - pa = VM_PAGE_TO_PHYS(m); seg = &vm_phys_segs[m->segind]; - while (order < VM_NFREEORDER - 1) { - pa_buddy = pa ^ (1 << (PAGE_SHIFT + order)); - if (pa_buddy < seg->start || - pa_buddy >= seg->end) - break; - m_buddy = &seg->first_page[atop(pa_buddy - seg->start)]; - if (m_buddy->order != order) - break; - fl = (*seg->free_queues)[m_buddy->pool]; - TAILQ_REMOVE(&fl[m_buddy->order].pl, m_buddy, pageq); - fl[m_buddy->order].lcnt--; - m_buddy->order = VM_NFREEORDER; - if (m_buddy->pool != m->pool) - vm_phys_set_pool(m->pool, m_buddy, order); - order++; - pa &= ~((1 << (PAGE_SHIFT + order)) - 1); - m = &seg->first_page[atop(pa - seg->start)]; + if (order < VM_NFREEORDER - 1) { + pa = VM_PAGE_TO_PHYS(m); + do { + pa ^= ((vm_paddr_t)1 << (PAGE_SHIFT + order)); + if (pa < seg->start || pa >= seg->end) + break; + m_buddy = &seg->first_page[atop(pa - seg->start)]; + if (m_buddy->order != order) + break; + fl = (*seg->free_queues)[m_buddy->pool]; + TAILQ_REMOVE(&fl[order].pl, m_buddy, pageq); + fl[order].lcnt--; + m_buddy->order = VM_NFREEORDER; + if (m_buddy->pool != m->pool) + vm_phys_set_pool(m->pool, m_buddy, order); + order++; + pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); + m = &seg->first_page[atop(pa - seg->start)]; + } while (order < VM_NFREEORDER - 1); } m->order = order; fl = (*seg->free_queues)[m->pool]; @@ -593,6 +574,47 @@ vm_phys_free_pages(vm_page_t m, int orde } /* + * Free a contiguous, arbitrarily sized set of physical pages. + * + * The free page queues must be locked. + */ +void +vm_phys_free_contig(vm_page_t m, u_long npages) +{ + u_int n; + int order; + + /* + * Avoid unnecessary coalescing by freeing the pages in the largest + * possible power-of-two-sized subsets. + */ + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + for (;; npages -= n) { + /* + * Unsigned "min" is used here so that "order" is assigned + * "VM_NFREEORDER - 1" when "m"'s physical address is zero + * or the low-order bits of its physical address are zero + * because the size of a physical address exceeds the size of + * a long. + */ + order = min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, + VM_NFREEORDER - 1); + n = 1 << order; + if (npages < n) + break; + vm_phys_free_pages(m, order); + m += n; + } + /* The residual "npages" is less than "1 << (VM_NFREEORDER - 1)". */ + for (; npages > 0; npages -= n) { + order = flsl(npages) - 1; + n = 1 << order; + vm_phys_free_pages(m, order); + m += n; + } +} + +/* * Set the pool for a contiguous, power of two-sized set of physical pages. */ void @@ -728,14 +750,15 @@ vm_phys_zero_pages_idle(void) * "alignment" and "boundary" must be a power of two. */ vm_page_t -vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary) +vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary) { struct vm_freelist *fl; struct vm_phys_seg *seg; struct vnode *vp; vm_paddr_t pa, pa_last, size; vm_page_t deferred_vdrop_list, m, m_ret; + u_long npages_end; int domain, flind, i, oind, order, pind; #if VM_NDOMAIN > 1 @@ -848,13 +871,10 @@ done: deferred_vdrop_list = m; } } - for (; i < roundup2(npages, 1 << imin(oind, order)); i++) { - m = &m_ret[i]; - KASSERT(m->order == VM_NFREEORDER, - ("vm_phys_alloc_contig: page %p has unexpected order %d", - m, m->order)); - vm_phys_free_pages(m, 0); - } + /* Return excess pages to the free lists. */ + npages_end = roundup2(npages, 1 << imin(oind, order)); + if (npages < npages_end) + vm_phys_free_contig(&m_ret[npages], npages_end - npages); mtx_unlock(&vm_page_queue_free_mtx); while (deferred_vdrop_list != NULL) { vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev); Modified: user/attilio/vmcontention/sys/vm/vm_phys.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_phys.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_phys.h Sun Oct 30 11:43:12 2011 (r226932) @@ -50,12 +50,11 @@ struct mem_affinity { extern struct mem_affinity *mem_affinity; void vm_phys_add_page(vm_paddr_t pa); -vm_page_t vm_phys_alloc_contig(unsigned long npages, - vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary); +vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary); vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order); vm_page_t vm_phys_alloc_pages(int pool, int order); -vm_paddr_t vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment); +void vm_phys_free_contig(vm_page_t m, u_long npages); void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); void vm_phys_set_pool(int pool, vm_page_t m, int order); Modified: user/attilio/vmcontention/sys/vm/vm_reserv.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_reserv.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_reserv.c Sun Oct 30 11:43:12 2011 (r226932) @@ -616,7 +616,7 @@ vm_reserv_reclaim_inactive(void) */ boolean_t vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low, vm_paddr_t high, - unsigned long alignment, unsigned long boundary) + u_long alignment, vm_paddr_t boundary) { vm_paddr_t pa, pa_length; vm_reserv_t rv; Modified: user/attilio/vmcontention/sys/vm/vm_reserv.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_reserv.h Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/sys/vm/vm_reserv.h Sun Oct 30 11:43:12 2011 (r226932) @@ -49,8 +49,7 @@ void vm_reserv_init(void); int vm_reserv_level_iffullpop(vm_page_t m); boolean_t vm_reserv_reactivate_page(vm_page_t m); boolean_t vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low, - vm_paddr_t high, unsigned long alignment, - unsigned long boundary); + vm_paddr_t high, u_long alignment, vm_paddr_t boundary); boolean_t vm_reserv_reclaim_inactive(void); void vm_reserv_rename(vm_page_t m, vm_object_t new_object, vm_object_t old_object, vm_pindex_t old_object_offset); Copied: user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0 (from r226931, head/tools/regression/bin/sh/builtins/for1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0 Sun Oct 30 11:43:12 2011 (r226932, copy of r226931, head/tools/regression/bin/sh/builtins/for1.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +false +for i in `false`; do exit 3; done Modified: user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday Sun Oct 30 11:43:12 2011 (r226932) @@ -42,6 +42,7 @@ 01/30 Franklin Delano Roosevelt born in Hyde Park, New York, 1882 01/31 Jackie Robinson born, 1919 02/03 Gertrude Stein born, 1874 +02/04 Ken Thompson, creator of unix, born, 1943 02/05 Alex Harvey (SAHB) is born in Glasgow, Scotland, 1935 02/06 King George VI of UK dies; his daughter becomes Elizabeth II, 1952 02/07 Sinclair Lewis born, 1885 @@ -68,6 +69,7 @@ 02/22 Pierre Jules Cesar Janssen born, 1838, found hydrogen in the sun 02/23 W.E.B. DuBois born, 1868 02/24 Winslow Homer born, 1836 +02/24 Steve Jobs born, 1955 02/25 George Harrison born in Liverpool, England, 1943 02/25 Renoir born, 1841 02/26 Dominique Francois Jean Arago born, 1786; @@ -212,7 +214,7 @@ 09/08 Richard ``the Lionheart'', king of England born in Oxford, 1157 09/08 Peter Sellers born in Southsea, England, 1925 09/09 Chinese Communist Party Chairman Mao Tse-Tung dies at age 82, 1976 -09/09 Dennis Ritchie born, 1941 +09/09 Dennis MacAlistair Ritchie, creater of C, born, 1941 09/12 Jesse Owens born, 1913 09/13 Walter Reed born, 1851 09/15 Agatha Christie born in Torquay, England, 1890 @@ -239,6 +241,8 @@ 10/02 Mohandas K. Gandhi born at Porbandar, Kathiawad, India, 1869 10/04 John V. Atanasoff born, 1903 10/05 Ray Kroc (founder of McDonald's) born, 1902 +10/05 Steve Jobs died at the age of 56, 2011 +10/12 Dennis MacAlistair Ritchie died at the age of 70, 2011 10/13 Lenny Bruce is born in New York City, 1925 10/13 Virgil (Publius Vergilius Maro) born near Mantua, Italy, 70 BC 10/14 Dwight David Eisenhower, 34th President of the United States, born in Modified: user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd Sun Oct 30 11:43:12 2011 (r226932) @@ -109,6 +109,7 @@ 03/28 Sean C. Farley born in Indianapolis, Indiana, United States, 1970 03/29 Thierry Thomas born in Luxeuil les Bains, France, 1961 03/30 Po-Chuan Hsieh born in Taipei, Taiwan, Republic of China, 1978 +03/31 First quarter status reports are due on 04/15 04/01 Matthew Jacob born in San Francisco, California, United States, 1958 04/01 Bill Fenner born in Bellefonte, Pennsylvania, United States, 1971 04/01 Peter Edwards born in Dublin, Ireland, 1973 @@ -199,6 +200,7 @@ 06/29 Daniel Harris born in Lubbock, Texas, United States, 1985 06/29 Andrew Pantyukhin born in Moscow, Russian Federation, 1985 06/30 Guido van Rooij born in Best, Noord-Brabant, the Netherlands, 1965 +06/30 Second quarter status reports are due on 07/15 07/01 Matthew Dillon born in San Francisco, California, United States, 1966 07/02 Mark Christopher Ovens born in Preston, Lancashire, United Kingdom, 1958 07/02 Vasil Venelinov Dimov born in Shumen, Bulgaria, 1982 @@ -282,6 +284,7 @@ 09/28 Alex Dupre born in Milano, Italy, 1980 09/29 Matthew Hunt born in Johnstown, Pennsylvania, United States, 1976 09/30 Hiten M. Pandya born in Dar-es-Salaam, Tanzania, East Africa, 1986 +09/30 Third quarter status reports are due on 10/15 10/02 Beat Gaetzi born in Zurich, Switzerland, 1980 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 @@ -341,5 +344,6 @@ 12/28 Ade Lovett born in London, England, 1969 12/28 Marius Strobl born in Cham, Bavaria, Germany, 1978 12/31 Edwin Groothuis born in Geldrop, the Netherlands, 1970 +12/31 Fourth quarter status reports are due on 01/15 #endif /* !_calendar_freebsd_ */ Modified: user/attilio/vmcontention/usr.bin/sed/sed.1 ============================================================================== --- user/attilio/vmcontention/usr.bin/sed/sed.1 Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/usr.bin/sed/sed.1 Sun Oct 30 11:43:12 2011 (r226932) @@ -343,7 +343,7 @@ can be preceded by white space and can b The function can be preceded by white space. The terminating .Dq } -must be preceded by a newline or optional white space. +must be preceded by a newline, and may also be preceded by white space. .Pp .Bl -tag -width "XXXXXX" -compact .It [2addr] function-list Modified: user/attilio/vmcontention/usr.bin/who/who.1 ============================================================================== --- user/attilio/vmcontention/usr.bin/who/who.1 Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/usr.bin/who/who.1 Sun Oct 30 11:43:12 2011 (r226932) @@ -28,7 +28,7 @@ .\" @(#)who.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd May 8, 2002 +.Dd Oct 28, 2011 .Dt WHO 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display who is on the system .Sh SYNOPSIS .Nm -.Op Fl HmqsTu +.Op Fl bHmqsTu .Op Cm am I .Op Ar file .Sh DESCRIPTION @@ -48,6 +48,8 @@ remote hostname if not local. .Pp The options are as follows: .Bl -tag -width indent +.It Fl b +Write the time and date of the last system reboot. .It Fl H Write column headings above the output. .It Fl m Modified: user/attilio/vmcontention/usr.bin/who/who.c ============================================================================== --- user/attilio/vmcontention/usr.bin/who/who.c Sun Oct 30 11:25:44 2011 (r226931) +++ user/attilio/vmcontention/usr.bin/who/who.c Sun Oct 30 11:43:12 2011 (r226932) @@ -48,14 +48,16 @@ __FBSDID("$FreeBSD$"); #include static void heading(void); +static void boottime(void); static void process_utmp(void); static void quick(void); -static void row(struct utmpx *); +static void row(const struct utmpx *); static int ttywidth(void); static void usage(void); static void whoami(void); static int Hflag; /* Write column headings */ +static int bflag; /* Show date of the last reboot */ static int mflag; /* Show info about current terminal */ static int qflag; /* "Quick" mode */ static int sflag; /* Show name, line, time */ @@ -69,7 +71,7 @@ main(int argc, char *argv[]) setlocale(LC_TIME, ""); - while ((ch = getopt(argc, argv, "HTmqsu")) != -1) { + while ((ch = getopt(argc, argv, "HTbmqsu")) != -1) { switch (ch) { case 'H': /* Write column headings */ Hflag = 1; @@ -77,6 +79,9 @@ main(int argc, char *argv[]) case 'T': /* Show terminal state */ Tflag = 1; break; + case 'b': /* Show date of the last reboot */ + bflag = 1; + break; case 'm': /* Show info about current terminal */ mflag = 1; break; @@ -121,6 +126,8 @@ main(int argc, char *argv[]) heading(); if (mflag) whoami(); + else if (bflag) + boottime(); else process_utmp(); } @@ -134,7 +141,7 @@ static void usage(void) { - fprintf(stderr, "usage: who [-HmqsTu] [am I] [file]\n"); + fprintf(stderr, "usage: who [-bHmqsTu] [am I] [file]\n"); exit(1); } @@ -145,14 +152,14 @@ heading(void) printf("%-16s ", "NAME"); if (Tflag) printf("S "); - printf("%-8s %-12s ", "LINE", "TIME"); + printf("%-12s %-12s ", "LINE", "TIME"); if (uflag) printf("IDLE "); printf("%-16s\n", "FROM"); } static void -row(struct utmpx *ut) +row(const struct utmpx *ut) { char buf[80], tty[PATH_MAX]; struct stat sb; @@ -178,7 +185,10 @@ row(struct utmpx *ut) printf("%-16s ", ut->ut_user); if (Tflag) printf("%c ", state); - printf("%-8s ", ut->ut_line); + if (ut->ut_type == BOOT_TIME) + printf("%-12s ", "system boot"); + else + printf("%-12s ", ut->ut_line); t = ut->ut_tv.tv_sec; tm = localtime(&t); strftime(buf, sizeof(buf), d_first ? "%e %b %R" : "%b %e %R", tm); @@ -225,6 +235,17 @@ process_utmp(void) } static void +boottime(void) +{ + struct utmpx u1, *u2; + + u1.ut_type = BOOT_TIME; + if ((u2 = getutxid(&u1)) == NULL) + return; + row(u2); +} + +static void quick(void) { struct utmpx *utx; From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 12:11:13 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AD93106566B; Sun, 30 Oct 2011 12:11:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0678FC08; Sun, 30 Oct 2011 12:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UCBCaS067566; Sun, 30 Oct 2011 12:11:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UCBCOc067564; Sun, 30 Oct 2011 12:11:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110301211.p9UCBCOc067564@svn.freebsd.org> From: Adrian Chadd Date: Sun, 30 Oct 2011 12:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226933 - user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 12:11:13 -0000 Author: adrian Date: Sun Oct 30 12:11:12 2011 New Revision: 226933 URL: http://svn.freebsd.org/changeset/base/226933 Log: For now, flip off 11n chipset OFDM weak signal detection by default. I've noticed in very congested environments that the AR9220's I have get very upset and spew out tens of thousands of OFDM PHY errors a second (OFDM restart, mostly.) The AR9160 in the same environment doesn't log anywhere near as many OFDM errors and does not at all get "stuck beacon" issues. I however think the stuck beacon condition that I and testers have been seeing is due to other issues, rather than specifically caused by lots of PHY errors. I think the PHY errors are just setting it off. Merlin does seem to have a "baseband hang" bit in the hang capability set, I have no idea what the baseband hangs are or what the workarounds are. In any case, I'll keep digging. Newma has this disabled in hostap mode and leaves it default in STA mode (I think this is 'whatever is in the ini file values.') It will be enabled if the beacon RSSI is strong enough. Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sun Oct 30 11:43:12 2011 (r226932) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sun Oct 30 12:11:12 2011 (r226933) @@ -611,7 +611,7 @@ ar5416AniReset(struct ath_hal *ah, const ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, 0); ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, 0); ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, - AH_TRUE); + AH_FALSE); ar5416AniControl(ah, HAL_ANI_CCK_WEAK_SIGNAL_THR, AH_FALSE); ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, 0); ichan->privFlags |= CHANNEL_ANI_SETUP; From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 20:45:27 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48471065780; Sun, 30 Oct 2011 20:45:27 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A52608FC14; Sun, 30 Oct 2011 20:45:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UKjRsB083911; Sun, 30 Oct 2011 20:45:27 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UKjRcQ083909; Sun, 30 Oct 2011 20:45:27 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201110302045.p9UKjRcQ083909@svn.freebsd.org> From: Jeff Roberson Date: Sun, 30 Oct 2011 20:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226941 - user/attilio/vmcontention/sys/amd64/amd64 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 20:45:27 -0000 Author: jeff Date: Sun Oct 30 20:45:27 2011 New Revision: 226941 URL: http://svn.freebsd.org/changeset/base/226941 Log: - Eliminate a use of the splay right link by using the object pointer for a temporary singly linked list. Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sun Oct 30 16:29:04 2011 (r226940) +++ user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sun Oct 30 20:45:27 2011 (r226941) @@ -1425,7 +1425,8 @@ pmap_free_zero_pages(vm_page_t free) while (free != NULL) { m = free; - free = m->right; + free = (void *)m->object; + m->object = NULL; /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } @@ -1444,7 +1445,7 @@ pmap_add_delayed_free_list(vm_page_t m, m->flags |= PG_ZERO; else m->flags &= ~PG_ZERO; - m->right = *free; + m->object = (void *)*free; *free = m; } From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 22:57:43 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2891E106566C; Sun, 30 Oct 2011 22:57:43 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1852A8FC15; Sun, 30 Oct 2011 22:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UMvg8G088490; Sun, 30 Oct 2011 22:57:42 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UMvgar088487; Sun, 30 Oct 2011 22:57:42 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201110302257.p9UMvgar088487@svn.freebsd.org> From: Jeff Roberson Date: Sun, 30 Oct 2011 22:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226952 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 22:57:43 -0000 Author: jeff Date: Sun Oct 30 22:57:42 2011 New Revision: 226952 URL: http://svn.freebsd.org/changeset/base/226952 Log: - Extract part of vm_radix_lookupn() into a function that just finds the first leaf page in a specified range. This permits us to make many search & operate functions without much code duplication. - Make a generic iterator for radix items. Modified: user/attilio/vmcontention/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h Modified: user/attilio/vmcontention/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.c Sun Oct 30 22:20:17 2011 (r226951) +++ user/attilio/vmcontention/sys/vm/vm_radix.c Sun Oct 30 22:57:42 2011 (r226952) @@ -364,30 +364,25 @@ vm_radix_color(struct vm_radix *rtree, v } /* - * Looks up as many as cnt values between start and end, and stores - * them in the caller allocated array out. The next index can be used - * to restart the scan. This optimizes forward scans in the tree. + * Find the first leaf with a valid node between *startp and end. Return + * the index of the first valid item in the leaf in *startp. */ -int -vm_radix_lookupn(struct vm_radix *rtree, vm_pindex_t start, - vm_pindex_t end, int color, void **out, int cnt, vm_pindex_t *next) +static struct vm_radix_node * +vm_radix_leaf(struct vm_radix *rtree, vm_pindex_t *startp, vm_pindex_t end) { struct vm_radix_node *rnode; + vm_pindex_t start; vm_pindex_t inc; int slot; int level; - void *val; - int outidx; - CTR3(KTR_VM, "lookupn: tree %p, start %p, end %p", - rtree, (void *)start, (void *)end); - outidx = 0; + start = *startp; restart: level = vm_radix_height(rtree, &rnode); - if (rnode == NULL || start > VM_RADIX_MAX(level)) - goto out; - if (end && start >= end) + if (start > VM_RADIX_MAX(level) || (end && start >= end)) { + rnode = NULL; goto out; + } /* * Search the tree from the top for any leaf node holding an index * between start and end. @@ -395,7 +390,7 @@ restart: for (level--; level; level--) { slot = vm_radix_slot(start, level); CTR5(KTR_VM, - "lookupn: tree %p, index %p, level %d, slot %d, child %p", + "leaf: tree %p, index %p, level %d, slot %d, child %p", rtree, (void *)start, level, slot, rnode->rn_child[slot]); if (rnode->rn_child[slot] != NULL) { rnode = rnode->rn_child[slot]; @@ -412,12 +407,14 @@ restart: start += inc; slot++; CTR5(KTR_VM, - "lookupn: start %p end %p inc %d mask 0x%lX slot %d", + "leaf: start %p end %p inc %d mask 0x%lX slot %d", (void *)start, (void *)end, inc, ~VM_RADIX_MAX(level), slot); for (; slot < VM_RADIX_COUNT; slot++, start += inc) { - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + rnode = NULL; goto out; + } if (rnode->rn_child[slot]) { rnode = rnode->rn_child[slot]; break; @@ -426,33 +423,81 @@ restart: if (slot == VM_RADIX_COUNT) goto restart; } - slot = vm_radix_slot(start, 0); - for (; slot < VM_RADIX_COUNT; slot++, start++) { + +out: + *startp = start; + return (rnode); +} + + + +/* + * Looks up as many as cnt values between start and end, and stores + * them in the caller allocated array out. The next index can be used + * to restart the scan. This optimizes forward scans in the tree. + */ +int +vm_radix_lookupn(struct vm_radix *rtree, vm_pindex_t start, + vm_pindex_t end, int color, void **out, int cnt, vm_pindex_t *next) +{ + struct vm_radix_node *rnode; + void *val; + int slot; + int outidx; + + CTR3(KTR_VM, "lookupn: tree %p, start %p, end %p", + rtree, (void *)start, (void *)end); + if (rtree->rt_root == 0) + return (0); + outidx = 0; + while ((rnode = vm_radix_leaf(rtree, &start, end)) != NULL) { + slot = vm_radix_slot(start, 0); + for (; slot < VM_RADIX_COUNT; slot++, start++) { + if (end != 0 && start >= end) + goto out; + val = vm_radix_match(rnode->rn_child[slot], color); + if (val == NULL) + continue; + CTR4(KTR_VM, + "lookupn: tree %p index %p slot %d found child %p", + rtree, (void *)start, slot, val); + out[outidx] = val; + if (++outidx == cnt) + goto out; + } if (end != 0 && start >= end) - goto out; - val = vm_radix_match(rnode->rn_child[slot], color); - if (val == NULL) - continue; - CTR4(KTR_VM, - "lookupn: tree %p index %p slot %d found child %p", - rtree, (void *)start, slot, val); - out[outidx++] = val; - if (outidx == cnt) - goto out; + break; } - /* - * Go fetch the next page to fill the requested number of pages - * otherwise the caller will simply call us again to fulfill the - * same request after the structures are pushed out of cache. - */ - if ((end == 0 || start < end)) - goto restart; out: *next = start; - return (outidx); } +void +vm_radix_foreach(struct vm_radix *rtree, vm_pindex_t start, vm_pindex_t end, + int color, void (*iter)(void *)) +{ + struct vm_radix_node *rnode; + void *val; + int slot; + + if (rtree->rt_root == 0) + return; + while ((rnode = vm_radix_leaf(rtree, &start, end)) != NULL) { + slot = vm_radix_slot(start, 0); + for (; slot < VM_RADIX_COUNT; slot++, start++) { + if (end != 0 && start >= end) + return; + val = vm_radix_match(rnode->rn_child[slot], color); + if (val) + iter(val); + } + if (end != 0 && start >= end) + return; + } +} + + /* * Look up any entry at a position less than or equal to index. */ Modified: user/attilio/vmcontention/sys/vm/vm_radix.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.h Sun Oct 30 22:20:17 2011 (r226951) +++ user/attilio/vmcontention/sys/vm/vm_radix.h Sun Oct 30 22:57:42 2011 (r226952) @@ -74,12 +74,14 @@ void vm_radix_shrink(struct vm_radix *) /* * Functions which work on specified colors. (object, vm_page_queue_free locks) */ -void *vm_radix_color(struct vm_radix *, vm_pindex_t, int color); -void *vm_radix_lookup(struct vm_radix *, vm_pindex_t, int color); -int vm_radix_lookupn(struct vm_radix *rtree, vm_pindex_t start, - vm_pindex_t end, int color, void **out, int cnt, vm_pindex_t *next); -void *vm_radix_lookup_le(struct vm_radix *, vm_pindex_t, int color); -void *vm_radix_remove(struct vm_radix *, vm_pindex_t, int color); +void *vm_radix_color(struct vm_radix *, vm_pindex_t, int); +void *vm_radix_lookup(struct vm_radix *, vm_pindex_t, int); +int vm_radix_lookupn(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, + void **, int, vm_pindex_t *); +void *vm_radix_lookup_le(struct vm_radix *, vm_pindex_t, int); +void *vm_radix_remove(struct vm_radix *, vm_pindex_t, int); +void vm_radix_foreach(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, + void (*)(void *)); /* * Look up any entry at a position greater or equal to index. From owner-svn-src-user@FreeBSD.ORG Sun Oct 30 23:31:03 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B941065670; Sun, 30 Oct 2011 23:31:03 +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 919308FC0A; Sun, 30 Oct 2011 23:31:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UNV3w6089559; Sun, 30 Oct 2011 23:31:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UNV3TI089557; Sun, 30 Oct 2011 23:31:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110302331.p9UNV3TI089557@svn.freebsd.org> From: Doug Barton Date: Sun, 30 Oct 2011 23:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226953 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 23:31:03 -0000 Author: dougb Date: Sun Oct 30 23:31:03 2011 New Revision: 226953 URL: http://svn.freebsd.org/changeset/base/226953 Log: For multiple -r, don't add a port to the list of dependents to rebuild if it was itself specified as a -r port. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sun Oct 30 22:57:42 2011 (r226952) +++ user/dougb/portmaster/portmaster Sun Oct 30 23:31:03 2011 (r226953) @@ -2641,6 +2641,10 @@ urb_update () { for req_by in `grep -l DEPORIGIN:${origin}$ $pdb/*/+CONTENTS`; do req_by="${req_by%/+CONTENTS}" req_by="${req_by##*/}" + + case " $PM_URB_IPORTS" in *" $req_by "*) continue ;; esac + case " $PM_URB_ORIGINS" in *" `origin_from_pdb $req_by` "*) continue ;; esac + PM_URB_LIST="${PM_URB_LIST} ${req_by}" done done From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 00:10:12 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28132106566B; Mon, 31 Oct 2011 00:10:12 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184FC8FC0C; Mon, 31 Oct 2011 00:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V0ABfb090764; Mon, 31 Oct 2011 00:10:11 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V0ABwh090762; Mon, 31 Oct 2011 00:10:11 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201110310010.p9V0ABwh090762@svn.freebsd.org> From: Jeff Roberson Date: Mon, 31 Oct 2011 00:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226954 - user/attilio/vmcontention/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 00:10:12 -0000 Author: jeff Date: Mon Oct 31 00:10:11 2011 New Revision: 226954 URL: http://svn.freebsd.org/changeset/base/226954 Log: - Convert object->cache usage to the radix tree. Modified: user/attilio/vmcontention/sys/kern/uipc_shm.c Modified: user/attilio/vmcontention/sys/kern/uipc_shm.c ============================================================================== --- user/attilio/vmcontention/sys/kern/uipc_shm.c Sun Oct 30 23:31:03 2011 (r226953) +++ user/attilio/vmcontention/sys/kern/uipc_shm.c Mon Oct 31 00:10:11 2011 (r226954) @@ -289,10 +289,23 @@ shm_dotruncate(struct shmfd *shmfd, off_ * a page swapped out to disk? */ if ((length & PAGE_MASK) && - (m = vm_page_lookup(object, OFF_TO_IDX(length))) != NULL && - m->valid != 0) { - int base = (int)length & PAGE_MASK; - int size = PAGE_SIZE - base; + (m = vm_radix_lookup(&object->rtree, OFF_TO_IDX(length), + VM_RADIX_ANY)) != NULL) { + int base; + int size; + + if (m->flags & PG_CACHED) { + mtx_lock(&vm_page_queue_free_mtx); + if (m->object == object) + vm_page_cache_remove(m); + mtx_unlock(&vm_page_queue_free_mtx); + goto out; + } + if (m->valid != 0 || m->object != object) + goto out; + + base = (int)length & PAGE_MASK; + size = PAGE_SIZE - base; pmap_zero_page_area(m, base, size); @@ -311,10 +324,6 @@ shm_dotruncate(struct shmfd *shmfd, off_ base = roundup2(base, DEV_BSIZE); vm_page_clear_dirty(m, base, PAGE_SIZE - base); - } else if ((length & PAGE_MASK) && - __predict_false(object->cache != NULL)) { - vm_page_cache_free(object, OFF_TO_IDX(length), - nobjsize); } } else { @@ -326,6 +335,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ } object->charge += delta; } +out: shmfd->shm_size = length; mtx_lock(&shm_timestamp_lock); vfs_timestamp(&shmfd->shm_ctime); From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 02:43:36 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70AAF106566B; Mon, 31 Oct 2011 02:43:36 +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 612B08FC13; Mon, 31 Oct 2011 02:43:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V2ha5G095402; Mon, 31 Oct 2011 02:43:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V2haVw095400; Mon, 31 Oct 2011 02:43:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110310243.p9V2haVw095400@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 02:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226955 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 02:43:36 -0000 Author: dougb Date: Mon Oct 31 02:43:36 2011 New Revision: 226955 URL: http://svn.freebsd.org/changeset/base/226955 Log: If an update fails in a child port the parent needs to source the $IPC_SAVE file before it bails out to make sure that various lists are updated in the parent. This is particularly important for the list(s) of work already completed, and especially to update PM_NEEDS_UPDATE for the message of how to resume from the point of failure. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Oct 31 00:10:11 2011 (r226954) +++ user/dougb/portmaster/portmaster Mon Oct 31 02:43:36 2011 (r226955) @@ -2291,8 +2291,9 @@ update_port () { unset NO_DEP_UPDATES if [ -z "$NO_ACTION" -o -n "$PM_FIRST_PASS" ]; then - ($0 $ARGS $1) || fail "Update for $1 failed" + ($0 $ARGS $1) || update_failed=update_failed . $IPC_SAVE + [ -n "$update_failed" ] && fail "Update for $1 failed" else pm_v "===>>> Build canceled due to -n flag" fi @@ -2780,8 +2781,9 @@ multiport () { numports=$(( $numports + 1 )) init_term_printf "$port ${numports}/${numports}" - ($0 $ARGS $port) || fail "Update for $port failed" + ($0 $ARGS $port) || update_failed=update_failed . $IPC_SAVE + [ -n "$update_failed" ] && fail "Update for $port failed" case "$PM_NEEDS_UPDATE" in *\ $origin\ *) continue ;; # Handle +IGNOREME in child @@ -2821,8 +2823,9 @@ multiport () { num=$(( $num + 1 )) init_term_printf "$port ${num}/${numports}" - ($0 $ARGS $port) || fail "Update for $port failed" + ($0 $ARGS $port) || update_failed=update_failed . $IPC_SAVE + [ -n "$update_failed" ] && fail "Update for $port failed" done if [ -n "$PM_URB" ]; then From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 08:23:22 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A500F106566C; Mon, 31 Oct 2011 08:23:22 +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 9564C8FC1C; Mon, 31 Oct 2011 08:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V8NMZ3006114; Mon, 31 Oct 2011 08:23:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V8NMvW006112; Mon, 31 Oct 2011 08:23:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110310823.p9V8NMvW006112@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 08:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226957 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 08:23:22 -0000 Author: dougb Date: Mon Oct 31 08:23:22 2011 New Revision: 226957 URL: http://svn.freebsd.org/changeset/base/226957 Log: Add a feature to allow users to list files that should be preserved across upgrades. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Oct 31 03:47:23 2011 (r226956) +++ user/dougb/portmaster/portmaster Mon Oct 31 08:23:22 2011 (r226957) @@ -3672,6 +3672,18 @@ if [ -n "$upg_port" -o -n "$ro_upg_port" # Could be empty if -o if [ -n "$upg_port" ]; then + case " $PM_PRESERVE_PORTS " in + *" $portdir "*) + preserve_port=`echo $portdir | sed 's#[-+/\.]#_#g'` + eval preserve_port_files="\$${preserve_port}_files" + preserve_dir=`mktemp -d ${TMPDIR}/d-${PM_PARENT_PID}-${preserve_port}` + for file in $preserve_port_files; do + cp -p $file ${preserve_dir}/ || + fail "Cannot copy $file, which is in \$${preserve_port}_files" + done + unset preserve_port files + esac + pm_sv "Running pkg_delete for $upg_port" pm_pkg_delete_s -f $upg_port fi @@ -3733,6 +3745,34 @@ else install_failed ${latest_pv}.tbz fi fi + +for file in $preserve_port_files; do + mv $file ${file}-new + mv ${preserve_dir}/${file##*/} $file + oldmd5="MD5:`md5 -q $file`" + + newcon=`pm_mktemp contents` + while read left right; do + case "$left" in + @cwd) short_file="${file#${right}/}" ;; + $short_file) found_it=found_it ; continue;; + @comment) if [ -n "$found_it" ]; then + echo -e "${short_file}-new\n$left $right" + echo -e "$short_file\n@comment $oldmd5" + unset found_it + continue + fi ;; + esac + echo "$left $right" + done < $pdb/$new_port/+CONTENTS > $newcon + mv $newcon $pdb/$new_port/+CONTENTS + unset file oldmd5 newcon left right short_file +done +if [ -n "$preserve_dir" ]; then + rmdir $preserve_dir 2>/dev/null + unset preserve_dir +fi + echo '' [ "$PM_DEL_BUILD_ONLY" = doing_build_only_dep ] && From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 08:29:12 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3336B1065670; Mon, 31 Oct 2011 08:29:12 +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 09A358FC12; Mon, 31 Oct 2011 08:29:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V8TBB6006316; Mon, 31 Oct 2011 08:29:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V8TBuC006314; Mon, 31 Oct 2011 08:29:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110310829.p9V8TBuC006314@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 08:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226958 - user/dougb/portmaster/files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 08:29:12 -0000 Author: dougb Date: Mon Oct 31 08:29:11 2011 New Revision: 226958 URL: http://svn.freebsd.org/changeset/base/226958 Log: Delete trailing whitespace Modified: user/dougb/portmaster/files/portmaster.rc.sample.in Modified: user/dougb/portmaster/files/portmaster.rc.sample.in ============================================================================== --- user/dougb/portmaster/files/portmaster.rc.sample.in Mon Oct 31 08:23:22 2011 (r226957) +++ user/dougb/portmaster/files/portmaster.rc.sample.in Mon Oct 31 08:29:11 2011 (r226958) @@ -35,7 +35,7 @@ # # Arguments to pass to make (-m) # PM_MAKE_ARGS='-DFORCE_PKG_REGISTER' -# +# # Recurse through every dependency, and child dependencies (-t) # # NOTE: USE OF THIS OPTION IN YOUR CONFIG FILE IS NOT RECOMMENDED @@ -43,57 +43,57 @@ # USED FROM THE COMMAND LINE. # # RECURSE_THOROUGH=topt -# +# # Be verbose (-v) # PM_VERBOSE=vopt -# +# # Save copies of old shared libraries (recommended) (-w) # SAVE_SHARED=wopt -# +# # Install a package if available (-P or --packages) # PM_PACKAGES=first -# +# # Only install packages (-PP or --packages-only) # PM_PACKAGES=only -# +# # Install packages for build-only dependencies (--packages-build) # PM_PACKAGES_BUILD=pmp_build -# +# # Delete build-only dependencies when finished (--delete-build-only) # PM_DEL_BUILD_ONLY=pm_dbo -# +# # Use packages if they are newer than installed (--packages-newer) # PM_PACKAGES=newer # PM_PACKAGES_NEWER=pmp_newer -# +# # Always fetch new package files (--always-fetch) # PM_ALWAYS_FETCH=pm_always_fetch -# +# # Specify a local package repository (--local-packagedir) # LOCAL_PACKAGEDIR= -# +# # Only use packages from --local-packagedir (--packages-local) # PM_PACKAGES_LOCAL=pmp_local -# +# # Delete packages after they are installed (--delete-packages) # PM_DELETE_PACKAGES=pm_delete_packages -# +# # Suppress the build confirmation message (--no-confirm) # PM_NO_CONFIRM=pm_no_confirm -# +# # Do not update the xterm title bar (--no-term-title) # PM_NO_TERM_TITLE=pm_no_term_title -# +# # Do not fetch the INDEX file (--no-index-fetch) # PM_NO_INDEX_FETCH=pm_no_index_fetch -# +# # Use only the INDEX file to check if a port is out of date (--index) # PM_INDEX=pm_index -# +# # Use the INDEX file first, then check /usr/ports (--index-first) # PM_INDEX=pm_index # PM_INDEX_FIRST=pm_index_first -# +# # Use the INDEX file instead of /usr/ports (--index-only) # PM_INDEX=pm_index # PM_INDEX_ONLY=pm_index_only From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 08:32:36 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 725EB106566B; Mon, 31 Oct 2011 08:32:36 +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 62A668FC14; Mon, 31 Oct 2011 08:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V8WaJU006457; Mon, 31 Oct 2011 08:32:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V8Waf8006455; Mon, 31 Oct 2011 08:32:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110310832.p9V8Waf8006455@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 08:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226959 - user/dougb/portmaster/files X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 08:32:36 -0000 Author: dougb Date: Mon Oct 31 08:32:36 2011 New Revision: 226959 URL: http://svn.freebsd.org/changeset/base/226959 Log: Document the PM_PRESERVE_PORTS feature Modified: user/dougb/portmaster/files/portmaster.rc.sample.in Modified: user/dougb/portmaster/files/portmaster.rc.sample.in ============================================================================== --- user/dougb/portmaster/files/portmaster.rc.sample.in Mon Oct 31 08:29:11 2011 (r226958) +++ user/dougb/portmaster/files/portmaster.rc.sample.in Mon Oct 31 08:32:36 2011 (r226959) @@ -106,3 +106,9 @@ # # Do not prompt the user for failed backup package creation # PM_IGNORE_FAILED_BACKUP_PACKAGE=pm_ignore_failed_backup_package +# +# List of files to preserve across upgrades, and the ports that install them. +# You can convert category/portname to the right pattern for the _files variable +# by using the following: echo category/portname | sed 's#[-+/\.]#_#g' +# PM_PRESERVE_PORTS="dns/p5-Net-DNS" +# dns_p5_Net_DNS_files="/usr/local/share/doc/p5-Net-DNS/TODO" From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 09:06:33 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3D13106566B; Mon, 31 Oct 2011 09:06:33 +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 C47078FC13; Mon, 31 Oct 2011 09:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9V96Xtw007666; Mon, 31 Oct 2011 09:06:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9V96X2a007664; Mon, 31 Oct 2011 09:06:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110310906.p9V96X2a007664@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 09:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226962 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 09:06:33 -0000 Author: dougb Date: Mon Oct 31 09:06:33 2011 New Revision: 226962 URL: http://svn.freebsd.org/changeset/base/226962 Log: Unset preserve_port_files when we're done Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Oct 31 08:59:17 2011 (r226961) +++ user/dougb/portmaster/portmaster Mon Oct 31 09:06:33 2011 (r226962) @@ -3763,14 +3763,14 @@ for file in $preserve_port_files; do continue fi ;; esac - echo "$left $right" + echo "$left $right" done < $pdb/$new_port/+CONTENTS > $newcon mv $newcon $pdb/$new_port/+CONTENTS unset file oldmd5 newcon left right short_file done if [ -n "$preserve_dir" ]; then rmdir $preserve_dir 2>/dev/null - unset preserve_dir + unset preserve_dir preserve_port_files fi echo '' From owner-svn-src-user@FreeBSD.ORG Mon Oct 31 21:05:19 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 811731065673; Mon, 31 Oct 2011 21:05: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 7124E8FC1D; Mon, 31 Oct 2011 21:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9VL5JTY034147; Mon, 31 Oct 2011 21:05:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9VL5JX0034145; Mon, 31 Oct 2011 21:05:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201110312105.p9VL5JX0034145@svn.freebsd.org> From: Doug Barton Date: Mon, 31 Oct 2011 21:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226972 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 21:05:19 -0000 Author: dougb Date: Mon Oct 31 21:05:19 2011 New Revision: 226972 URL: http://svn.freebsd.org/changeset/base/226972 Log: For the preserve files feature use the same naming and installation scheme for the new contents file as is done in update_contents() Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Oct 31 20:24:33 2011 (r226971) +++ user/dougb/portmaster/portmaster Mon Oct 31 21:05:19 2011 (r226972) @@ -3751,7 +3751,7 @@ for file in $preserve_port_files; do mv ${preserve_dir}/${file##*/} $file oldmd5="MD5:`md5 -q $file`" - newcon=`pm_mktemp contents` + new_cont=`pm_mktemp contents` while read left right; do case "$left" in @cwd) short_file="${file#${right}/}" ;; @@ -3764,9 +3764,10 @@ for file in $preserve_port_files; do fi ;; esac echo "$left $right" - done < $pdb/$new_port/+CONTENTS > $newcon - mv $newcon $pdb/$new_port/+CONTENTS - unset file oldmd5 newcon left right short_file + done < $pdb/$new_port/+CONTENTS > $new_cont + pm_install_s $new_cont $contents + pm_unlink $new_cont + unset file oldmd5 new_cont left right short_file done if [ -n "$preserve_dir" ]; then rmdir $preserve_dir 2>/dev/null From owner-svn-src-user@FreeBSD.ORG Tue Nov 1 03:40:38 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8939F106564A; Tue, 1 Nov 2011 03:40:38 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E77F8FC0A; Tue, 1 Nov 2011 03:40:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA13ecYN047098; Tue, 1 Nov 2011 03:40:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA13ec6c047094; Tue, 1 Nov 2011 03:40:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111010340.pA13ec6c047094@svn.freebsd.org> From: Attilio Rao Date: Tue, 1 Nov 2011 03:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226980 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 03:40:38 -0000 Author: attilio Date: Tue Nov 1 03:40:38 2011 New Revision: 226980 URL: http://svn.freebsd.org/changeset/base/226980 Log: vm_object_terminate() doesn't actually free the pages in the splay tree. Reclaim all the nodes related to the radix tree for a specified vm_object when calling vm_object_terminate() via the newly added interface vm_radix_reclaim_nodes(). The function is recursive, but we have a well-defined maximum depth, thus the amount of necessary stack can be easilly calculated. Reported by: alc Discussed and reviewed by: jeff Modified: user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h Modified: user/attilio/vmcontention/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_object.c Tue Nov 1 02:04:52 2011 (r226979) +++ user/attilio/vmcontention/sys/vm/vm_object.c Tue Nov 1 03:40:38 2011 (r226980) @@ -756,6 +756,9 @@ vm_object_terminate(vm_object_t object) * assignment is that vm_page_free()'s call to * vm_page_remove() will return immediately without * modifying the page or the object. + * Anyway, the radix tree cannot be accessed anymore + * from within the object, thus all the nodes need + * to be reclaimed later on. */ p->object = NULL; if (p->wire_count == 0) { @@ -767,6 +770,7 @@ vm_object_terminate(vm_object_t object) if (n < VM_RADIX_STACK) break; } + vm_radix_reclaim_allnodes(&object->rtree); /* * If the object contained any pages, then reset it to an empty state. * None of the object's fields, including "resident_page_count", were Modified: user/attilio/vmcontention/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.c Tue Nov 1 02:04:52 2011 (r226979) +++ user/attilio/vmcontention/sys/vm/vm_radix.c Tue Nov 1 03:40:38 2011 (r226980) @@ -223,6 +223,38 @@ vm_radix_match(void *child, int color) return ((void *)(c & ~VM_RADIX_FLAGS)); } +static void +vm_radix_reclaim_allnodes_internal(struct vm_radix_node *rnode, int level) +{ + int slot; + + MPASS(rnode != NULL && level >= 0); + + /* + * Level 0 just contains pages as children, thus make it a special + * case, free the node and return. + */ + if (level == 0) { + CTR2(KTR_VM, "reclaiming: node %p, level %d", rnode, level); + rnode->rn_count = 0; + vm_radix_node_put(rnode); + return; + } + for (slot = 0; slot < VM_RADIX_COUNT && rnode->rn_count != 0; slot++) { + if (rnode->rn_child[slot] == NULL) + continue; + CTR3(KTR_VM, + "reclaiming: node %p, level %d recursing in slot %d", + rnode, level, slot); + vm_radix_reclaim_allnodes_internal(rnode->rn_child[slot], + level - 1); + rnode->rn_count--; + } + MPASS(rnode->rn_count == 0); + CTR2(KTR_VM, "reclaiming: node %p, level %d", rnode, level); + vm_radix_node_put(rnode); +} + /* * Inserts the key-value pair in to the radix tree. Returns errno. * Panics if the key already exists. @@ -640,6 +672,24 @@ vm_radix_remove(struct vm_radix *rtree, } /* + * Remove and free all the nodes from the radix tree. + * This function is recrusive but there is a tight control on it as the + * maximum depth of the tree is fixed. + */ +void +vm_radix_reclaim_allnodes(struct vm_radix *rtree) +{ + struct vm_radix_node *root; + int level; + + if (rtree->rt_root == 0) + return; + level = vm_radix_height(rtree, &root); + vm_radix_reclaim_allnodes_internal(root, level - 1); + rtree->rt_root = 0; +} + +/* * Attempts to reduce the height of the tree. */ void Modified: user/attilio/vmcontention/sys/vm/vm_radix.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.h Tue Nov 1 02:04:52 2011 (r226979) +++ user/attilio/vmcontention/sys/vm/vm_radix.h Tue Nov 1 03:40:38 2011 (r226980) @@ -79,6 +79,7 @@ void *vm_radix_lookup(struct vm_radix *, int vm_radix_lookupn(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, void **, int, vm_pindex_t *); void *vm_radix_lookup_le(struct vm_radix *, vm_pindex_t, int); +void vm_radix_reclaim_allnodes(struct vm_radix *); void *vm_radix_remove(struct vm_radix *, vm_pindex_t, int); void vm_radix_foreach(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, void (*)(void *)); From owner-svn-src-user@FreeBSD.ORG Tue Nov 1 03:53:11 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BC971065670; Tue, 1 Nov 2011 03:53:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB928FC13; Tue, 1 Nov 2011 03:53:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA13rBw0047501; Tue, 1 Nov 2011 03:53:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA13rBAb047499; Tue, 1 Nov 2011 03:53:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111010353.pA13rBAb047499@svn.freebsd.org> From: Attilio Rao Date: Tue, 1 Nov 2011 03:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226981 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 03:53:11 -0000 Author: attilio Date: Tue Nov 1 03:53:10 2011 New Revision: 226981 URL: http://svn.freebsd.org/changeset/base/226981 Log: Add kernel protection to the header file for vmradix. Likely this file needs some more restructuration (and we should make a lot of macros private to radix implementation) but leave them as they are so far because we may enrich the KPI much further. Modified: user/attilio/vmcontention/sys/vm/vm_radix.h Modified: user/attilio/vmcontention/sys/vm/vm_radix.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.h Tue Nov 1 03:40:38 2011 (r226980) +++ user/attilio/vmcontention/sys/vm/vm_radix.h Tue Nov 1 03:53:10 2011 (r226981) @@ -50,6 +50,8 @@ CTASSERT(VM_RADIX_HEIGHT >= VM_RADIX_LIM ((h) == VM_RADIX_LIMIT ? ((vm_pindex_t)-1) : \ (((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1)) +#ifdef _KERNEL + struct vm_radix_node { void *rn_child[VM_RADIX_COUNT]; /* child nodes. */ uint16_t rn_count; /* Valid children. */ @@ -97,4 +99,5 @@ vm_radix_lookup_ge(struct vm_radix *rtre return (NULL); } +#endif /* _KERNEL */ #endif /* !_VM_RADIX_H_ */ From owner-svn-src-user@FreeBSD.ORG Tue Nov 1 04:01:39 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3DB9106564A; Tue, 1 Nov 2011 04:01:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D04A38FC15; Tue, 1 Nov 2011 04:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA141dFR047853; Tue, 1 Nov 2011 04:01:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA141dTS047827; Tue, 1 Nov 2011 04:01:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111010401.pA141dTS047827@svn.freebsd.org> From: Attilio Rao Date: Tue, 1 Nov 2011 04:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226982 - in user/attilio/vmcontention: bin/cat bin/ln bin/mkdir bin/mv bin/ps bin/rm bin/test cddl/lib/libzfs cddl/sbin/zfs cddl/sbin/zpool cddl/usr.bin/zinject cddl/usr.bin/ztest cddl... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 04:01:40 -0000 Author: attilio Date: Tue Nov 1 04:01:39 2011 New Revision: 226982 URL: http://svn.freebsd.org/changeset/base/226982 Log: MFC Modified: user/attilio/vmcontention/bin/cat/cat.c user/attilio/vmcontention/bin/ln/ln.c user/attilio/vmcontention/bin/mkdir/mkdir.c user/attilio/vmcontention/bin/mv/mv.c user/attilio/vmcontention/bin/ps/print.c user/attilio/vmcontention/bin/ps/ps.1 user/attilio/vmcontention/bin/rm/rm.c user/attilio/vmcontention/bin/test/test.c user/attilio/vmcontention/cddl/lib/libzfs/Makefile user/attilio/vmcontention/cddl/sbin/zfs/Makefile user/attilio/vmcontention/cddl/sbin/zpool/Makefile user/attilio/vmcontention/cddl/usr.bin/zinject/Makefile user/attilio/vmcontention/cddl/usr.bin/ztest/Makefile user/attilio/vmcontention/cddl/usr.sbin/zdb/Makefile user/attilio/vmcontention/contrib/llvm/tools/clang/lib/Basic/Targets.cpp user/attilio/vmcontention/contrib/tzdata/australasia user/attilio/vmcontention/contrib/tzdata/backward user/attilio/vmcontention/contrib/tzdata/europe user/attilio/vmcontention/contrib/tzdata/northamerica user/attilio/vmcontention/contrib/tzdata/zone.tab user/attilio/vmcontention/libexec/rshd/rshd.c user/attilio/vmcontention/sys/contrib/pf/net/pf.c user/attilio/vmcontention/sys/dev/esp/esp_sbus.c user/attilio/vmcontention/sys/dev/esp/ncr53c9x.c user/attilio/vmcontention/sys/dev/esp/ncr53c9xreg.h user/attilio/vmcontention/sys/dev/esp/ncr53c9xvar.h user/attilio/vmcontention/sys/dev/md/md.c user/attilio/vmcontention/sys/sparc64/sbus/dma_sbus.c user/attilio/vmcontention/sys/sparc64/sbus/lsi64854.c user/attilio/vmcontention/sys/sparc64/sbus/lsi64854var.h user/attilio/vmcontention/sys/ufs/ufs/ufs_vnops.c user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/bind9/ (props changed) user/attilio/vmcontention/contrib/binutils/ (props changed) user/attilio/vmcontention/contrib/bzip2/ (props changed) user/attilio/vmcontention/contrib/com_err/ (props changed) user/attilio/vmcontention/contrib/compiler-rt/ (props changed) user/attilio/vmcontention/contrib/dialog/ (props changed) user/attilio/vmcontention/contrib/ee/ (props changed) user/attilio/vmcontention/contrib/expat/ (props changed) user/attilio/vmcontention/contrib/file/ (props changed) user/attilio/vmcontention/contrib/gcc/ (props changed) user/attilio/vmcontention/contrib/gdb/ (props changed) user/attilio/vmcontention/contrib/gdtoa/ (props changed) user/attilio/vmcontention/contrib/gnu-sort/ (props changed) user/attilio/vmcontention/contrib/groff/ (props changed) user/attilio/vmcontention/contrib/less/ (props changed) user/attilio/vmcontention/contrib/libpcap/ (props changed) user/attilio/vmcontention/contrib/libstdc++/ (props changed) user/attilio/vmcontention/contrib/llvm/ (props changed) user/attilio/vmcontention/contrib/llvm/tools/clang/ (props changed) user/attilio/vmcontention/contrib/ncurses/ (props changed) user/attilio/vmcontention/contrib/netcat/ (props changed) user/attilio/vmcontention/contrib/ntp/ (props changed) user/attilio/vmcontention/contrib/one-true-awk/ (props changed) user/attilio/vmcontention/contrib/openbsm/ (props changed) user/attilio/vmcontention/contrib/openpam/ (props changed) user/attilio/vmcontention/contrib/openresolv/ (props changed) user/attilio/vmcontention/contrib/pf/ (props changed) user/attilio/vmcontention/contrib/sendmail/ (props changed) user/attilio/vmcontention/contrib/tcpdump/ (props changed) user/attilio/vmcontention/contrib/tcsh/ (props changed) user/attilio/vmcontention/contrib/tnftp/ (props changed) user/attilio/vmcontention/contrib/top/ (props changed) user/attilio/vmcontention/contrib/top/install-sh (props changed) user/attilio/vmcontention/contrib/tzcode/stdtime/ (props changed) user/attilio/vmcontention/contrib/tzcode/zic/ (props changed) user/attilio/vmcontention/contrib/tzdata/ (props changed) user/attilio/vmcontention/contrib/wpa/ (props changed) user/attilio/vmcontention/contrib/xz/ (props changed) user/attilio/vmcontention/crypto/heimdal/ (props changed) user/attilio/vmcontention/crypto/openssh/ (props changed) user/attilio/vmcontention/crypto/openssl/ (props changed) user/attilio/vmcontention/gnu/lib/ (props changed) user/attilio/vmcontention/gnu/usr.bin/binutils/ (props changed) user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/ (props changed) user/attilio/vmcontention/gnu/usr.bin/gdb/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libc/stdtime/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/lib/libz/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/mk/bsd.arch.inc.mk (props changed) user/attilio/vmcontention/share/zoneinfo/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/amd64/include/xen/ (props changed) user/attilio/vmcontention/sys/boot/ (props changed) user/attilio/vmcontention/sys/boot/i386/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/ski/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/ofw/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/ (props changed) user/attilio/vmcontention/sys/contrib/octeon-sdk/ (props changed) user/attilio/vmcontention/sys/contrib/pf/ (props changed) user/attilio/vmcontention/sys/contrib/x86emu/ (props changed) user/attilio/vmcontention/usr.bin/calendar/ (props changed) user/attilio/vmcontention/usr.bin/csup/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) user/attilio/vmcontention/usr.sbin/ndiscvt/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvctl/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvd/ (props changed) user/attilio/vmcontention/usr.sbin/rtsold/ (props changed) user/attilio/vmcontention/usr.sbin/zic/ (props changed) Modified: user/attilio/vmcontention/bin/cat/cat.c ============================================================================== --- user/attilio/vmcontention/bin/cat/cat.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/cat/cat.c Tue Nov 1 04:01:39 2011 (r226982) @@ -64,9 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include -int bflag, eflag, nflag, sflag, tflag, vflag; -int rval; -const char *filename; +static int bflag, eflag, nflag, sflag, tflag, vflag; +static int rval; +static const char *filename; static void usage(void); static void scanfiles(char *argv[], int cooked); Modified: user/attilio/vmcontention/bin/ln/ln.c ============================================================================== --- user/attilio/vmcontention/bin/ln/ln.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/ln/ln.c Tue Nov 1 04:01:39 2011 (r226982) @@ -54,16 +54,16 @@ __FBSDID("$FreeBSD$"); #include #include -int fflag; /* Unlink existing files. */ -int Fflag; /* Remove empty directories also. */ -int hflag; /* Check new name for symlink first. */ -int iflag; /* Interactive mode. */ -int Pflag; /* Create hard links to symlinks. */ -int sflag; /* Symbolic, not hard, link. */ -int vflag; /* Verbose output. */ -int wflag; /* Warn if symlink target does not +static int fflag; /* Unlink existing files. */ +static int Fflag; /* Remove empty directories also. */ +static int hflag; /* Check new name for symlink first. */ +static int iflag; /* Interactive mode. */ +static int Pflag; /* Create hard links to symlinks. */ +static int sflag; /* Symbolic, not hard, link. */ +static int vflag; /* Verbose output. */ +static int wflag; /* Warn if symlink target does not * exist, and -f is not enabled. */ -char linkch; +static char linkch; int linkit(const char *, const char *, int); void usage(void); Modified: user/attilio/vmcontention/bin/mkdir/mkdir.c ============================================================================== --- user/attilio/vmcontention/bin/mkdir/mkdir.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/mkdir/mkdir.c Tue Nov 1 04:01:39 2011 (r226982) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static int build(char *, mode_t); static void usage(void); -int vflag; +static int vflag; int main(int argc, char *argv[]) Modified: user/attilio/vmcontention/bin/mv/mv.c ============================================================================== --- user/attilio/vmcontention/bin/mv/mv.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/mv/mv.c Tue Nov 1 04:01:39 2011 (r226982) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); /* Exit code for a failed exec. */ #define EXEC_FAILED 127 -int fflg, iflg, nflg, vflg; +static int fflg, iflg, nflg, vflg; static int copy(const char *, const char *); static int do_move(const char *, const char *); Modified: user/attilio/vmcontention/bin/ps/print.c ============================================================================== --- user/attilio/vmcontention/bin/ps/print.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/ps/print.c Tue Nov 1 04:01:39 2011 (r226982) @@ -362,7 +362,7 @@ tdev(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) - str = strdup("??"); + str = strdup("-"); else asprintf(&str, "%#jx", (uintmax_t)dev); @@ -379,7 +379,7 @@ tname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - str = strdup("?? "); + str = strdup("- "); else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) @@ -403,7 +403,7 @@ longtname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - ttname = "??"; + ttname = "-"; return (strdup(ttname)); } Modified: user/attilio/vmcontention/bin/ps/ps.1 ============================================================================== --- user/attilio/vmcontention/bin/ps/ps.1 Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/ps/ps.1 Tue Nov 1 04:01:39 2011 (r226982) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2011 +.Dd October 30, 2011 .Dt PS 1 .Os .Sh NAME @@ -437,6 +437,10 @@ This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +A +.Ql - +without a preceding two letter abbreviation or pseudo-terminal device number +indicates a process which never had a controlling terminal. The full pathname of the controlling terminal is available via the .Cm tty keyword. Modified: user/attilio/vmcontention/bin/rm/rm.c ============================================================================== --- user/attilio/vmcontention/bin/rm/rm.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/rm/rm.c Tue Nov 1 04:01:39 2011 (r226982) @@ -57,10 +57,10 @@ __FBSDID("$FreeBSD$"); #include #include -int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; -int rflag, Iflag; -uid_t uid; -volatile sig_atomic_t info; +static int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; +static int rflag, Iflag; +static uid_t uid; +static volatile sig_atomic_t info; int check(char *, char *, struct stat *); int check2(char **); Modified: user/attilio/vmcontention/bin/test/test.c ============================================================================== --- user/attilio/vmcontention/bin/test/test.c Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/bin/test/test.c Tue Nov 1 04:01:39 2011 (r226982) @@ -118,7 +118,7 @@ enum token_types { PAREN }; -struct t_op { +static struct t_op { const char *op_text; short op_num, op_type; } const ops [] = { @@ -165,10 +165,10 @@ struct t_op { {0, 0, 0} }; -struct t_op const *t_wp_op; -int nargc; -char **t_wp; -int parenlevel; +static struct t_op const *t_wp_op; +static int nargc; +static char **t_wp; +static int parenlevel; static int aexpr(enum token); static int binop(void); Modified: user/attilio/vmcontention/cddl/lib/libzfs/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/lib/libzfs/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/lib/libzfs/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -6,8 +6,8 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs -DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} -LDADD= -lmd -lpthread -lumem -lutil +DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} +LDADD= -lmd -lpthread -lumem -lutil -lm SRCS= deviceid.c \ fsshare.c \ Modified: user/attilio/vmcontention/cddl/sbin/zfs/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/sbin/zfs/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/sbin/zfs/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -DPADD= ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} ${LIBUMEM} \ +DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs +LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs .include Modified: user/attilio/vmcontention/cddl/sbin/zpool/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/sbin/zpool/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/sbin/zpool/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -26,8 +26,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -DPADD= ${LIBAVL} ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} \ +DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lavl -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs +LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs .include Modified: user/attilio/vmcontention/cddl/usr.bin/zinject/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/usr.bin/zinject/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/usr.bin/zinject/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -19,8 +19,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ +DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ ${LIBZFS} ${LIBZPOOL} -LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool +LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool .include Modified: user/attilio/vmcontention/cddl/usr.bin/ztest/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/usr.bin/ztest/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/usr.bin/ztest/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -18,8 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../lib/libumem DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ - ${LIBPTHREAD} ${LIBZ} ${LIBAVL} -LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl + ${LIBPTHREAD} ${LIBAVL} +LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lavl CSTD= c99 Modified: user/attilio/vmcontention/cddl/usr.sbin/zdb/Makefile ============================================================================== --- user/attilio/vmcontention/cddl/usr.sbin/zdb/Makefile Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/cddl/usr.sbin/zdb/Makefile Tue Nov 1 04:01:39 2011 (r226982) @@ -23,9 +23,9 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ - ${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL} -LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool +DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ + ${LIBUUTIL} ${LIBZFS} ${LIBZPOOL} +LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool .include Modified: user/attilio/vmcontention/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- user/attilio/vmcontention/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Tue Nov 1 04:01:39 2011 (r226982) @@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo CK_K8SSE3, CK_Opteron, CK_OpteronSSE3, + CK_AMDFAM10, /// This specification is deprecated and will be removed in the future. /// Users should prefer \see CK_K8. @@ -1381,6 +1382,7 @@ public: .Case("k8-sse3", CK_K8SSE3) .Case("opteron", CK_Opteron) .Case("opteron-sse3", CK_OpteronSSE3) + .Case("amdfam10", CK_AMDFAM10) .Case("x86-64", CK_x86_64) .Case("geode", CK_Geode) .Default(CK_Generic); @@ -1441,6 +1443,7 @@ public: case CK_K8SSE3: case CK_Opteron: case CK_OpteronSSE3: + case CK_AMDFAM10: case CK_x86_64: return true; } @@ -1459,12 +1462,10 @@ void X86TargetInfo::getDefaultFeatures(l Features["ssse3"] = false; Features["sse41"] = false; Features["sse42"] = false; + Features["sse4a"] = false; Features["aes"] = false; Features["avx"] = false; - // LLVM does not currently recognize this. - // Features["sse4a"] = false; - // FIXME: This *really* should not be here. // X86_64 always has SSE2. @@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(l setFeatureEnabled(Features, "sse3", true); setFeatureEnabled(Features, "3dnowa", true); break; + case CK_AMDFAM10: + setFeatureEnabled(Features, "sse3", true); + setFeatureEnabled(Features, "sse4a", true); + setFeatureEnabled(Features, "3dnowa", true); + break; case CK_C3_2: setFeatureEnabled(Features, "mmx", true); setFeatureEnabled(Features, "sse", true); @@ -1604,6 +1610,8 @@ bool X86TargetInfo::setFeatureEnabled(ll else if (Name == "avx") Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; + else if (Name == "sse4a") + Features["sse4a"] = true; } else { if (Name == "mmx") Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false; @@ -1630,6 +1638,8 @@ bool X86TargetInfo::setFeatureEnabled(ll Features["aes"] = false; else if (Name == "avx") Features["avx"] = false; + else if (Name == "sse4a") + Features["sse4a"] = false; } return true; @@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(con Builder.defineMacro("__k8__"); Builder.defineMacro("__tune_k8__"); break; + case CK_AMDFAM10: + Builder.defineMacro("__amdfam10"); + Builder.defineMacro("__amdfam10__"); + Builder.defineMacro("__tune_amdfam10__"); + break; case CK_Geode: Builder.defineMacro("__geode"); Builder.defineMacro("__geode__"); Modified: user/attilio/vmcontention/contrib/tzdata/australasia ============================================================================== --- user/attilio/vmcontention/contrib/tzdata/australasia Tue Nov 1 03:53:10 2011 (r226981) +++ user/attilio/vmcontention/contrib/tzdata/australasia Tue Nov 1 04:01:39 2011 (r226982) @@ -1,5 +1,5 @@ #
-# @(#)australasia	8.28
+# @(#)australasia	8.29
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -308,6 +308,20 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # advance at 2am to 3am on October 23, 2011 and one hour back at 3am to 
 # 2am on February 26 next year.
 
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the  23rd of October, 2011.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
@@ -316,7 +330,7 @@ Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2011	only	-	Oct	23	2:00	1:00	S
-Rule	Fiji	2012	only	-	Feb	26	3:00	0	-
+Rule	Fiji	2012	only	-	Jan	22	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

Modified: user/attilio/vmcontention/contrib/tzdata/backward
==============================================================================
--- user/attilio/vmcontention/contrib/tzdata/backward	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/contrib/tzdata/backward	Tue Nov  1 04:01:39 2011	(r226982)
@@ -1,5 +1,5 @@
 # 
-# @(#)backward	8.10
+# @(#)backward	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -67,6 +67,7 @@ Link	America/Havana		Cuba
 Link	Africa/Cairo		Egypt
 Link	Europe/Dublin		Eire
 Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
 Link	Europe/London		GB
 Link	Europe/London		GB-Eire
 Link	Etc/GMT			GMT+0

Modified: user/attilio/vmcontention/contrib/tzdata/europe
==============================================================================
--- user/attilio/vmcontention/contrib/tzdata/europe	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/contrib/tzdata/europe	Tue Nov  1 04:01:39 2011	(r226982)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.39
+# @(#)europe	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1678,6 +1678,18 @@ Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov
 # a pre-1880 LMT offset of 1:58:32.
 #
 # (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter. 
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# 
+# http://ru.publika.md/link_317061.html
+# 
+
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Chisinau	1:55:20 -	LMT	1880
@@ -1694,21 +1706,6 @@ Zone	Europe/Chisinau	1:55:20 -	LMT	1880
 # See Romania commentary for the guessed 1997 transition to EU rules.
 			2:00	EU	EE%sT
 
-Zone	Europe/Tiraspol	1:58:32 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT	2011 Mar lastSun 1:00u
-			3:00	-	FET # Further-eastern European Time
-
 # Monaco
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.

Modified: user/attilio/vmcontention/contrib/tzdata/northamerica
==============================================================================
--- user/attilio/vmcontention/contrib/tzdata/northamerica	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/contrib/tzdata/northamerica	Tue Nov  1 04:01:39 2011	(r226982)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.50
+# @(#)northamerica	8.51
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2690,6 +2690,20 @@ Zone America/Costa_Rica	-5:36:20 -	LMT	1
 # 
 # http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
 # 
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back 
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# 
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# 
+#
+# Our page:
+# 
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
@@ -2721,12 +2735,14 @@ Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
 Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
 Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2006	2010	-	Oct	lastSun	0:00s	0	S
 Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
 Rule	Cuba	2009	2010	-	Mar	Sun>=8	0:00s	1:00	D
 Rule	Cuba	2011	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2011	only	-	Nov	13	0:00s	0	S
 Rule	Cuba	2012	max	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2012	max	-	Oct	lastSun	0:00s	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Havana	-5:29:28 -	LMT	1890

Modified: user/attilio/vmcontention/contrib/tzdata/zone.tab
==============================================================================
--- user/attilio/vmcontention/contrib/tzdata/zone.tab	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/contrib/tzdata/zone.tab	Tue Nov  1 04:01:39 2011	(r226982)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.50
+# @(#)zone.tab	8.52
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -257,8 +257,7 @@ LV	+5657+02406	Europe/Riga
 LY	+3254+01311	Africa/Tripoli
 MA	+3339-00735	Africa/Casablanca
 MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau	most locations
-MD	+4651+02938	Europe/Tiraspol	Pridnestrovie
+MD	+4700+02850	Europe/Chisinau
 ME	+4226+01916	Europe/Podgorica
 MF	+1804-06305	America/Marigot
 MG	-1855+04731	Indian/Antananarivo

Modified: user/attilio/vmcontention/libexec/rshd/rshd.c
==============================================================================
--- user/attilio/vmcontention/libexec/rshd/rshd.c	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/libexec/rshd/rshd.c	Tue Nov  1 04:01:39 2011	(r226982)
@@ -317,7 +317,7 @@ doit(struct sockaddr *fromp)
 	}
 
 	if ((pam_err = pam_set_item(pamh, PAM_RUSER, ruser)) != PAM_SUCCESS ||
-	    (pam_err = pam_set_item(pamh, PAM_RHOST, rhost) != PAM_SUCCESS)) {
+	    (pam_err = pam_set_item(pamh, PAM_RHOST, rhost)) != PAM_SUCCESS) {
 		syslog(LOG_ERR|LOG_AUTH, "pam_set_item(): %s",
 		    pam_strerror(pamh, pam_err));
 		rshd_errx(1, "Login incorrect.");

Modified: user/attilio/vmcontention/sys/contrib/pf/net/pf.c
==============================================================================
--- user/attilio/vmcontention/sys/contrib/pf/net/pf.c	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/sys/contrib/pf/net/pf.c	Tue Nov  1 04:01:39 2011	(r226982)
@@ -7176,11 +7176,15 @@ pf_test6(int dir, struct ifnet *ifp, str
 	}
 
 #ifdef __FreeBSD__
-	if (pd.pf_mtag->flags & PF_TAG_GENERATED)
+	if (pd.pf_mtag->flags & PF_TAG_GENERATED) {
+		PF_UNLOCK();
 #else
 	if (m->m_pkthdr.pf.flags & PF_TAG_GENERATED)
 #endif
 		return (PF_PASS);
+#ifdef __FreeBSD__
+	}
+#endif
 
 	/* We do IP header normalization and packet reassembly here */
 	if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) {

Modified: user/attilio/vmcontention/sys/dev/esp/esp_sbus.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/esp/esp_sbus.c	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/sys/dev/esp/esp_sbus.c	Tue Nov  1 04:01:39 2011	(r226982)
@@ -68,13 +68,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$");
 
 struct esp_softc {
 	struct ncr53c9x_softc	sc_ncr53c9x;	/* glue to MI code */
-	struct device		*sc_dev;
+	device_t		sc_dev;
 
 	struct resource		*sc_res;
 
@@ -102,8 +102,6 @@ struct esp_softc {
 	struct lsi64854_softc	*sc_dma;	/* pointer to my DMA */
 };
 
-static devclass_t	esp_devclass;
-
 static int	esp_probe(device_t);
 static int	esp_dma_attach(device_t);
 static int	esp_dma_detach(device_t);
@@ -118,7 +116,8 @@ static device_method_t esp_dma_methods[]
 	DEVMETHOD(device_detach,	esp_dma_detach),
 	DEVMETHOD(device_suspend,	esp_suspend),
 	DEVMETHOD(device_resume,	esp_resume),
-	{0, 0}
+
+	KOBJMETHOD_END
 };
 
 static driver_t esp_dma_driver = {
@@ -136,7 +135,8 @@ static device_method_t esp_sbus_methods[
 	DEVMETHOD(device_detach,	esp_sbus_detach),
 	DEVMETHOD(device_suspend,	esp_suspend),
 	DEVMETHOD(device_resume,	esp_resume),
-	{0, 0}
+
+	KOBJMETHOD_END	
 };
 
 static driver_t esp_sbus_driver = {
@@ -175,7 +175,6 @@ static const struct ncr53c9x_glue const 
 	esp_dma_go,
 	esp_dma_stop,
 	esp_dma_isactive,
-	NULL,			/* gl_clear_latched_intr */
 };
 
 static int
@@ -245,9 +244,9 @@ esp_sbus_attach(device_t dev)
 		    BUS_SPACE_MAXADDR,		/* lowaddr */
 		    BUS_SPACE_MAXADDR,		/* highaddr */
 		    NULL, NULL,			/* filter, filterarg */
-		    BUS_SPACE_MAXSIZE_32BIT,	/* maxsize */
-		    0,				/* nsegments */
-		    BUS_SPACE_MAXSIZE_32BIT,	/* maxsegsize */
+		    BUS_SPACE_MAXSIZE,		/* maxsize */
+		    BUS_SPACE_UNRESTRICTED,	/* nsegments */
+		    BUS_SPACE_MAXSIZE,		/* maxsegsize */
 		    0,				/* flags */
 		    NULL, NULL,			/* no locking */
 		    &lsc->sc_parent_dmat);
@@ -292,8 +291,10 @@ esp_sbus_attach(device_t dev)
 		}
 		for (i = 0; i < nchildren; i++) {
 			if (device_is_attached(children[i]) &&
-			    sbus_get_slot(children[i]) == sbus_get_slot(dev) &&
-			    strcmp(ofw_bus_get_name(children[i]), "dma") == 0) {
+			    sbus_get_slot(children[i]) ==
+			    sbus_get_slot(dev) &&
+			    strcmp(ofw_bus_get_name(children[i]),
+			    "dma") == 0) {
 				/* XXX hackery */
 				esc->sc_dma = (struct lsi64854_softc *)
 				    device_get_softc(children[i]);
@@ -453,13 +454,6 @@ espattach(struct esp_softc *esc, const s
 
 	NCR_LOCK_INIT(sc);
 
-	/* Attach the DMA engine. */
-	error = lsi64854_attach(esc->sc_dma);
-	if (error != 0) {
-		device_printf(esc->sc_dev, "lsi64854_attach failed\n");
-		goto fail_lock;
-	}
-
 	sc->sc_id = OF_getscsinitid(esc->sc_dev);
 
 #ifdef ESP_SBUS_DEBUG
@@ -516,9 +510,9 @@ espattach(struct esp_softc *esc, const s
 	NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2);
 
 	if ((NCR_READ_REG(sc, NCR_CFG2) & ~NCRCFG2_RSVD) !=
-	    (NCRCFG2_SCSI2 | NCRCFG2_RPE)) {
+	    (NCRCFG2_SCSI2 | NCRCFG2_RPE))
 		sc->sc_rev = NCR_VARIANT_ESP100;
-	} else {
+	else {
 		sc->sc_cfg2 = NCRCFG2_SCSI2;
 		NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2);
 		sc->sc_cfg3 = 0;
@@ -526,9 +520,9 @@ espattach(struct esp_softc *esc, const s
 		sc->sc_cfg3 = (NCRCFG3_CDB | NCRCFG3_FCLK);
 		NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3);
 		if (NCR_READ_REG(sc, NCR_CFG3) !=
-		    (NCRCFG3_CDB | NCRCFG3_FCLK)) {
+		    (NCRCFG3_CDB | NCRCFG3_FCLK))
 			sc->sc_rev = NCR_VARIANT_ESP100A;
-		} else {
+		else {
 			/* NCRCFG2_FE enables > 64K transfers. */
 			sc->sc_cfg2 |= NCRCFG2_FE;
 			sc->sc_cfg3 = 0;
@@ -543,9 +537,11 @@ espattach(struct esp_softc *esc, const s
 
 				case 0x02:
 					if ((uid & 0x07) == 0x02)
-						sc->sc_rev = NCR_VARIANT_FAS216;
+						sc->sc_rev =
+						    NCR_VARIANT_FAS216;
 					else
-						sc->sc_rev = NCR_VARIANT_FAS236;
+						sc->sc_rev =
+						    NCR_VARIANT_FAS236;
 					break;
 
 				case 0x0a:
@@ -560,7 +556,8 @@ espattach(struct esp_softc *esc, const s
 					 */
 					device_printf(esc->sc_dev,
 					    "Unknown chip\n");
-					goto fail_lsi;
+					error = ENXIO;
+					goto fail_lock;
 				}
 			}
 		}
@@ -571,12 +568,6 @@ espattach(struct esp_softc *esc, const s
 #endif
 
 	/*
-	 * XXX minsync and maxxfer _should_ be set up in MI code,
-	 * XXX but it appears to have some dependency on what sort
-	 * XXX of DMA we're hooked up to, etc.
-	 */
-
-	/*
 	 * This is the value used to start sync negotiations
 	 * Note that the NCR register "SYNCTP" is programmed
 	 * in "clocks per byte", and has a minimum value of 4.
@@ -587,31 +578,27 @@ espattach(struct esp_softc *esc, const s
 	 */
 	sc->sc_minsync = 1000 / sc->sc_freq;
 
+	/*
+	 * Except for some variants the maximum transfer size is 64k.
+	 */
+	sc->sc_maxxfer = 64 * 1024;
 	sc->sc_maxoffset = 15;
 	sc->sc_extended_geom = 1;
 
 	/*
 	 * Alas, we must now modify the value a bit, because it's
-	 * only valid when can switch on FASTCLK and FASTSCSI bits
-	 * in config register 3...
+	 * only valid when we can switch on FASTCLK and FASTSCSI bits
+	 * in the config register 3...
 	 */
 	switch (sc->sc_rev) {
 	case NCR_VARIANT_ESP100:
 		sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT;
-		sc->sc_maxxfer = 64 * 1024;
 		sc->sc_minsync = 0;	/* No synch on old chip? */
 		break;
 
 	case NCR_VARIANT_ESP100A:
-		sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT;
-		sc->sc_maxxfer = 64 * 1024;
-		/* Min clocks/byte is 5 */
-		sc->sc_minsync = ncr53c9x_cpb2stp(sc, 5);
-		break;
-
 	case NCR_VARIANT_ESP200:
 		sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT;
-		sc->sc_maxxfer = 16 * 1024 * 1024;
 		/* Min clocks/byte is 5 */
 		sc->sc_minsync = ncr53c9x_cpb2stp(sc, 5);
 		break;
@@ -642,6 +629,19 @@ espattach(struct esp_softc *esc, const s
 		break;
 	}
 
+	/*
+	 * Given that we allocate resources based on sc->sc_maxxfer it doesn't
+	 * make sense to supply a value higher than the maximum actually used.
+	 */
+	sc->sc_maxxfer = min(sc->sc_maxxfer, MAXPHYS);
+
+	/* Attach the DMA engine. */
+	error = lsi64854_attach(esc->sc_dma);
+	if (error != 0) {
+		device_printf(esc->sc_dev, "lsi64854_attach failed\n");
+		goto fail_lock;
+	}
+
 	/* Establish interrupt channel. */
 	i = 0;
 	if ((esc->sc_irqres = bus_alloc_resource_any(esc->sc_dev, SYS_RES_IRQ,

Modified: user/attilio/vmcontention/sys/dev/esp/ncr53c9x.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/esp/ncr53c9x.c	Tue Nov  1 03:53:10 2011	(r226981)
+++ user/attilio/vmcontention/sys/dev/esp/ncr53c9x.c	Tue Nov  1 04:01:39 2011	(r226982)
@@ -123,6 +123,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+devclass_t esp_devclass;
+
 MODULE_DEPEND(esp, cam, 1, 1, 1);
 
 #ifdef NCR53C9X_DEBUG
@@ -179,8 +181,7 @@ static inline int	ncr53c9x_stp2cpb(struc
 #define	NCR_SET_COUNT(sc, size) do {					\
 		NCR_WRITE_REG((sc), NCR_TCL, (size));			\
 		NCR_WRITE_REG((sc), NCR_TCM, (size) >> 8);		\
-		if ((sc->sc_cfg2 & NCRCFG2_FE) ||			\
-		    (sc->sc_rev == NCR_VARIANT_FAS366))			\
+		if ((sc->sc_features & NCR_F_LARGEXFER) != 0)		\
 			NCR_WRITE_REG((sc), NCR_TCH, (size) >> 16);	\
 		if (sc->sc_rev == NCR_VARIANT_FAS366)			\
 			NCR_WRITE_REG(sc, NCR_RCH, 0);			\
@@ -391,6 +392,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s
 		ecb = &sc->ecb_array[i];
 		ecb->sc = sc;
 		ecb->tag_id = i;
+		callout_init_mtx(&ecb->ch, &sc->sc_lock, 0);
 		TAILQ_INSERT_HEAD(&sc->free_list, ecb, free_links);
 	}
 
@@ -449,10 +451,10 @@ ncr53c9x_detach(struct ncr53c9x_softc *s
 	xpt_register_async(0, ncr53c9x_async, sc->sc_sim, sc->sc_path);
 	xpt_free_path(sc->sc_path);
 	xpt_bus_deregister(cam_sim_path(sc->sc_sim));
+	cam_sim_free(sc->sc_sim, TRUE);
 
 	NCR_UNLOCK(sc);
 
-	cam_sim_free(sc->sc_sim, TRUE);
 	free(sc->ecb_array, M_DEVBUF);
 	free(sc->sc_tinfo, M_DEVBUF);
 	if (sc->sc_imess_self)
@@ -504,6 +506,8 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc
 		/* FALLTHROUGH */
 	case NCR_VARIANT_ESP100A:
 		sc->sc_features |= NCR_F_SELATN3;
+		if ((sc->sc_cfg2 & NCRCFG2_FE) != 0)
+			sc->sc_features |= NCR_F_LARGEXFER;
 		NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2);
 		/* FALLTHROUGH */
 	case NCR_VARIANT_ESP100:
@@ -514,8 +518,8 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc
 		break;
 
 	case NCR_VARIANT_FAS366:
-		sc->sc_features |=
-		    NCR_F_HASCFG3 | NCR_F_FASTSCSI | NCR_F_SELATN3;
+		sc->sc_features |= NCR_F_HASCFG3 | NCR_F_FASTSCSI |
+		    NCR_F_SELATN3 | NCR_F_LARGEXFER;
 		sc->sc_cfg3 = NCRFASCFG3_FASTCLK | NCRFASCFG3_OBAUTO;
 		if (sc->sc_id > 7)
 			sc->sc_cfg3 |= NCRFASCFG3_IDBIT3;
@@ -711,9 +715,6 @@ ncr53c9x_readregs(struct ncr53c9x_softc 
 
 	sc->sc_espintr = NCR_READ_REG(sc, NCR_INTR);
 
-	if (sc->sc_glue->gl_clear_latched_intr != NULL)
-		(*sc->sc_glue->gl_clear_latched_intr)(sc);
-
 	/*
 	 * Determine the SCSI bus phase, return either a real SCSI bus phase
 	 * or some pseudo phase we use to detect certain exceptions.
@@ -806,7 +807,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 	struct ncr53c9x_tinfo *ti;
 	uint8_t *cmd;
 	size_t dmasize;
-	int clen, selatn3, selatns;
+	int clen, error, selatn3, selatns;
 	int lun = ecb->ccb->ccb_h.target_lun;
 	int target = ecb->ccb->ccb_h.target_id;
 
@@ -887,13 +888,19 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 		dmasize = clen;
 		sc->sc_cmdlen = clen;
 		sc->sc_cmdp = cmd;
-		NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize);
+		error = NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0,
+		    &dmasize);
+		if (error != 0) {
+			sc->sc_cmdlen = 0;
+			sc->sc_cmdp = NULL;
+			goto cmd;
+		}
+
 		/* Program the SCSI counter. */
 		NCR_SET_COUNT(sc, dmasize);
 
 		/* Load the count in. */
-		/* if (sc->sc_rev != NCR_VARIANT_FAS366) */
-			NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA);
+		NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA);
 
 		/* And get the target's attention. */
 		if (selatn3) {
@@ -906,6 +913,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 		return;
 	}
 
+cmd:
 	/*
 	 * Who am I?  This is where we tell the target that we are
 	 * happy for it to disconnect etc.
@@ -989,13 +997,11 @@ ncr53c9x_action(struct cam_sim *sim, uni
 	case XPT_RESET_BUS:
 		ncr53c9x_init(sc, 1);
 		ccb->ccb_h.status = CAM_REQ_CMP;
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_CALC_GEOMETRY:
 		cam_calc_geometry(&ccb->ccg, sc->sc_extended_geom);
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_PATH_INQ:
 		cpi = &ccb->cpi;
@@ -1009,19 +1015,19 @@ ncr53c9x_action(struct cam_sim *sim, uni
 		cpi->max_target = sc->sc_ntarg - 1;
 		cpi->max_lun = 7;
 		cpi->initiator_id = sc->sc_id;
-		cpi->bus_id = 0;
-		cpi->base_transfer_speed = 3300;
 		strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
-		strncpy(cpi->hba_vid, "Sun", HBA_IDLEN);
+		strncpy(cpi->hba_vid, "NCR", HBA_IDLEN);
 		strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
 		cpi->unit_number = cam_sim_unit(sim);
-		cpi->transport = XPORT_SPI;
-		cpi->transport_version = 2;
+		cpi->bus_id = 0;
+		cpi->base_transfer_speed = 3300;
 		cpi->protocol = PROTO_SCSI;
 		cpi->protocol_version = SCSI_REV_2;
+		cpi->transport = XPORT_SPI;
+		cpi->transport_version = 2;
+		cpi->maxio = sc->sc_maxxfer;
 		ccb->ccb_h.status = CAM_REQ_CMP;
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_GET_TRAN_SETTINGS:
 		cts = &ccb->cts;
@@ -1064,28 +1070,24 @@ ncr53c9x_action(struct cam_sim *sim, uni
 		    CTS_SPI_VALID_DISC;
 		scsi->valid = CTS_SCSI_VALID_TQ;
 		ccb->ccb_h.status = CAM_REQ_CMP;
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_ABORT:
 		device_printf(sc->sc_dev, "XPT_ABORT called\n");
 		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_TERM_IO:
 		device_printf(sc->sc_dev, "XPT_TERM_IO called\n");
 		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-		xpt_done(ccb);
-		return;
+		break;
 
 	case XPT_RESET_DEV:
 	case XPT_SCSI_IO:
 		if (ccb->ccb_h.target_id < 0 ||
 		    ccb->ccb_h.target_id >= sc->sc_ntarg) {
 			ccb->ccb_h.status = CAM_PATH_INVALID;
-			xpt_done(ccb);
-			return;
+			goto done;
 		}
 		/* Get an ECB to use. */
 		ecb = ncr53c9x_get_ecb(sc);
@@ -1097,8 +1099,7 @@ ncr53c9x_action(struct cam_sim *sim, uni
 			xpt_freeze_simq(sim, 1);
 			ccb->ccb_h.status = CAM_REQUEUE_REQ;
 			device_printf(sc->sc_dev, "unable to allocate ecb\n");
-			xpt_done(ccb);
-			return;
+			goto done;
 		}
 
 		/* Initialize ecb. */
@@ -1127,7 +1128,7 @@ ncr53c9x_action(struct cam_sim *sim, uni
 		ecb->flags |= ECB_READY;
 		if (sc->sc_state == NCR_IDLE)
 			ncr53c9x_sched(sc);
-		break;
+		return;
 
 	case XPT_SET_TRAN_SETTINGS:
 		cts = &ccb->cts;
@@ -1165,16 +1166,16 @@ ncr53c9x_action(struct cam_sim *sim, uni
 		}
 
 		ccb->ccb_h.status = CAM_REQ_CMP;
-		xpt_done(ccb);
-		return;
+		break;
 
 	default:
 		device_printf(sc->sc_dev, "Unhandled function code %d\n",
 		    ccb->ccb_h.func_code);
 		ccb->ccb_h.status = CAM_PROVIDE_FAIL;
-		xpt_done(ccb);
-		return;
 	}
+
+done:
+	xpt_done(ccb);
 }
 
 /*
@@ -2030,8 +2031,8 @@ gotit:
 
 			default:
 				xpt_print_path(ecb->ccb->ccb_h.path);
-				printf("unrecognized MESSAGE EXTENDED;"
-				    " sending REJECT\n");
+				printf("unrecognized MESSAGE EXTENDED 0x%x;"
+				    " sending REJECT\n", sc->sc_imess[2]);
 				goto reject;
 			}
 			break;
@@ -2039,7 +2040,8 @@ gotit:
 		default:
 			NCR_MSGS(("ident "));
 			xpt_print_path(ecb->ccb->ccb_h.path);
-			printf("unrecognized MESSAGE; sending REJECT\n");
+			printf("unrecognized MESSAGE 0x%x; sending REJECT\n",
+			    sc->sc_imess[0]);
 			/* FALLTHROUGH */
 		reject:
 			ncr53c9x_sched_msgout(SEND_REJECT);
@@ -2109,6 +2111,7 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s
 	struct ncr53c9x_tinfo *ti;
 	struct ncr53c9x_ecb *ecb;
 	size_t size;
+	int error;
 #ifdef NCR53C9X_DEBUG
 	int i;
 #endif

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

From owner-svn-src-user@FreeBSD.ORG  Tue Nov  1 04:21:57 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D46AF1065676;
	Tue,  1 Nov 2011 04:21:57 +0000 (UTC)
	(envelope-from jeff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C4B0D8FC1A;
	Tue,  1 Nov 2011 04:21:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA14LvDt048497;
	Tue, 1 Nov 2011 04:21:57 GMT (envelope-from jeff@svn.freebsd.org)
Received: (from jeff@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA14LvCQ048495;
	Tue, 1 Nov 2011 04:21:57 GMT (envelope-from jeff@svn.freebsd.org)
Message-Id: <201111010421.pA14LvCQ048495@svn.freebsd.org>
From: Jeff Roberson 
Date: Tue, 1 Nov 2011 04:21:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r226983 - user/attilio/vmcontention/sys/vm
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Nov 2011 04:21:57 -0000

Author: jeff
Date: Tue Nov  1 04:21:57 2011
New Revision: 226983
URL: http://svn.freebsd.org/changeset/base/226983

Log:
   - Add some convenience inlines.
   - Update the copyright.

Modified:
  user/attilio/vmcontention/sys/vm/vm_radix.h

Modified: user/attilio/vmcontention/sys/vm/vm_radix.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_radix.h	Tue Nov  1 04:01:39 2011	(r226982)
+++ user/attilio/vmcontention/sys/vm/vm_radix.h	Tue Nov  1 04:21:57 2011	(r226983)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2011 Jeffrey Roberson 
  * Copyright (c) 2008 Mayur Shardul 
  * All rights reserved.
  *
@@ -99,5 +100,37 @@ vm_radix_lookup_ge(struct vm_radix *rtre
         return (NULL);
 }
 
+static inline void *
+vm_radix_last(struct vm_radix *rtree, int color)
+{
+
+	return vm_radix_lookup_le(rtree, 0, color);
+}
+
+static inline void *
+vm_radix_first(struct vm_radix *rtree, int color)
+{
+
+	return vm_radix_lookup_ge(rtree, 0, color);
+}
+
+static inline void *
+vm_radix_next(struct vm_radix *rtree, vm_pindex_t index, int color)
+{
+
+	if (index == -1)
+		return (NULL);
+	return vm_radix_lookup_ge(rtree, index + 1, color);
+}
+
+static inline void *
+vm_radix_prev(struct vm_radix *rtree, vm_pindex_t index, int color)
+{
+
+	if (index == 0)
+		return (NULL);
+	return vm_radix_lookup_le(rtree, index - 1, color);
+}
+
 #endif /* _KERNEL */
 #endif /* !_VM_RADIX_H_ */

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 00:21:04 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23240106564A;
	Wed,  2 Nov 2011 00:21:04 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 137588FC17;
	Wed,  2 Nov 2011 00:21:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA20L3kE091941;
	Wed, 2 Nov 2011 00:21:03 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA20L3p2091939;
	Wed, 2 Nov 2011 00:21:03 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111020021.pA20L3p2091939@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 2 Nov 2011 00:21:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227010 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 00:21:04 -0000

Author: adrian
Date: Wed Nov  2 00:21:03 2011
New Revision: 227010
URL: http://svn.freebsd.org/changeset/base/227010

Log:
  Add further cyclic power threshold entries.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Tue Nov  1 23:12:22 2011	(r227009)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Wed Nov  2 00:21:03 2011	(r227010)
@@ -80,8 +80,8 @@ ar9280AniSetup(struct ath_hal *ah)
                 .coarseHigh             = { -14, -14, -14, -14, -12 },
                 .coarseLow              = { -64, -64, -64, -64, -70 },
                 .firpwr                 = { -78, -78, -78, -78, -80 },
-                .maxSpurImmunityLevel   = 2,
-                .cycPwrThr1             = { 2, 4, 6 },
+                .maxSpurImmunityLevel   = 7,    /* levels 0..7 */
+                .cycPwrThr1             = { 2, 4, 6, 8, 10, 12, 14, 16 },
                 .maxFirstepLevel        = 2,    /* levels 0..2 */
                 .firstep                = { 0, 4, 8 },
                 .ofdmTrigHigh           = 500,

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 14:23:57 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE281106564A;
	Wed,  2 Nov 2011 14:23:57 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE6AE8FC12;
	Wed,  2 Nov 2011 14:23:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2ENvVF025303;
	Wed, 2 Nov 2011 14:23:57 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2ENvBI025301;
	Wed, 2 Nov 2011 14:23:57 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111021423.pA2ENvBI025301@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 2 Nov 2011 14:23:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227019 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 14:23:57 -0000

Author: adrian
Date: Wed Nov  2 14:23:57 2011
New Revision: 227019
URL: http://svn.freebsd.org/changeset/base/227019

Log:
  Add a fix from atheros/linux ath9k, although it doesn't fix my merlin issue.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Wed Nov  2 13:51:29 2011	(r227018)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Wed Nov  2 14:23:57 2011	(r227019)
@@ -131,7 +131,7 @@ ar9280InitPLL(struct ath_hal *ah, const 
 	OS_DELAY(RTC_PLL_SETTLE_DELAY);
 	OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK);
 }
-
+	
 /* XXX shouldn't be here! */
 #define	EEP_MINOR(_ah) \
 	(AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK)
@@ -688,7 +688,9 @@ ar9280SpurMitigate(struct ath_hal *ah, c
 
     for (i = 0; i < 123; i++) {
         if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) {
-            if ((abs(cur_vit_mask - bin)) < 75) {
+            /* XXX GCC 4.2.4 workaround? */
+            volatile int tmp_abs = abs(cur_vit_mask - bin);
+            if (tmp_abs < 75) {
                 mask_amt = 1;
             } else {
                 mask_amt = 0;

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 17:40:21 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B68D6106564A;
	Wed,  2 Nov 2011 17:40:21 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C4EB8FC0A;
	Wed,  2 Nov 2011 17:40:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2HeLhT031408;
	Wed, 2 Nov 2011 17:40:21 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2HeLpe031406;
	Wed, 2 Nov 2011 17:40:21 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111021740.pA2HeLpe031406@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 2 Nov 2011 17:40:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227022 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 17:40:21 -0000

Author: adrian
Date: Wed Nov  2 17:40:21 2011
New Revision: 227022
URL: http://svn.freebsd.org/changeset/base/227022

Log:
  Update the AR9280 TX/RX gain type assignment to be correct for earlier
  EEPROM versions.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Wed Nov  2 16:39:10 2011	(r227021)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Wed Nov  2 17:40:21 2011	(r227022)
@@ -309,43 +309,55 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 		ath_hal_printf(ah, "[ath]: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm; curves will be adjusted.\n",
 		    AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset);
 
-	/* XXX check for >= minor ver 17 */
 	if (AR_SREV_MERLIN_20(ah)) {
-		/* setup rxgain table */
-		switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE, AH_NULL)) {
-		case AR5416_EEP_RXGAIN_13dB_BACKOFF:
-			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
-			    ar9280Modes_backoff_13db_rxgain_v2, 6);
-			break;
-		case AR5416_EEP_RXGAIN_23dB_BACKOFF:
-			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
-			    ar9280Modes_backoff_23db_rxgain_v2, 6);
-			break;
-		case AR5416_EEP_RXGAIN_ORIG:
+		if (EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_17) {
+			/* setup rxgain table */
+			switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE,
+			    AH_NULL)) {
+			case AR5416_EEP_RXGAIN_13dB_BACKOFF:
+				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
+				    ar9280Modes_backoff_13db_rxgain_v2, 6);
+				break;
+			case AR5416_EEP_RXGAIN_23dB_BACKOFF:
+				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
+				    ar9280Modes_backoff_23db_rxgain_v2, 6);
+				break;
+			case AR5416_EEP_RXGAIN_ORIG:
+				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
+				    ar9280Modes_original_rxgain_v2, 6);
+				break;
+			default:
+				HALASSERT(AH_FALSE);
+				goto bad;
+			}
+		} else {
+			/* Default to original RX gain */
 			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
 			    ar9280Modes_original_rxgain_v2, 6);
-			break;
-		default:
-			HALASSERT(AH_FALSE);
-			goto bad;		/* XXX ? try to continue */
 		}
 	}
 
-	/* XXX check for >= minor ver 19 */
 	if (AR_SREV_MERLIN_20(ah)) {
-		/* setp txgain table */
-		switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) {
-		case AR5416_EEP_TXGAIN_HIGH_POWER:
-			HAL_INI_INIT(&ahp9280->ah_ini_txgain,
-			    ar9280Modes_high_power_tx_gain_v2, 6);
-			break;
-		case AR5416_EEP_TXGAIN_ORIG:
+		if (EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_19) {
+			/* setp txgain table */
+			switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE,
+			    AH_NULL)) {
+			case AR5416_EEP_TXGAIN_HIGH_POWER:
+				HAL_INI_INIT(&ahp9280->ah_ini_txgain,
+				    ar9280Modes_high_power_tx_gain_v2, 6);
+				break;
+			case AR5416_EEP_TXGAIN_ORIG:
+				HAL_INI_INIT(&ahp9280->ah_ini_txgain,
+				    ar9280Modes_original_tx_gain_v2, 6);
+				break;
+			default:
+				HALASSERT(AH_FALSE);
+				goto bad;
+			}
+		} else {
+			/* Default to original TX gain */
 			HAL_INI_INIT(&ahp9280->ah_ini_txgain,
 			    ar9280Modes_original_tx_gain_v2, 6);
-			break;
-		default:
-			HALASSERT(AH_FALSE);
-			goto bad;		/* XXX ? try to continue */
 		}
 	}
 

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 19:06:01 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DA59106564A;
	Wed,  2 Nov 2011 19:06:01 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 64BF28FC13;
	Wed,  2 Nov 2011 19:06:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2J61Ah034262;
	Wed, 2 Nov 2011 19:06:01 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2J61TC034260;
	Wed, 2 Nov 2011 19:06:01 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111021906.pA2J61TC034260@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 19:06:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227026 - user/des/sizes
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 19:06:01 -0000

Author: des
Date: Wed Nov  2 19:06:01 2011
New Revision: 227026
URL: http://svn.freebsd.org/changeset/base/227026

Log:
   is not required.

Modified:
  user/des/sizes/sizes.c

Modified: user/des/sizes/sizes.c
==============================================================================
--- user/des/sizes/sizes.c	Wed Nov  2 18:55:26 2011	(r227025)
+++ user/des/sizes/sizes.c	Wed Nov  2 19:06:01 2011	(r227026)
@@ -27,8 +27,6 @@
  * $FreeBSD$
  */
 
-#include 
-
 #include 
 #include 
 #include 

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 19:10:39 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43026106564A;
	Wed,  2 Nov 2011 19:10:39 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A20C8FC0C;
	Wed,  2 Nov 2011 19:10:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2JAcsS034431;
	Wed, 2 Nov 2011 19:10:38 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2JAc55034429;
	Wed, 2 Nov 2011 19:10:38 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111021910.pA2JAc55034429@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 19:10:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227027 - user/des/sizes
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 19:10:39 -0000

Author: des
Date: Wed Nov  2 19:10:38 2011
New Revision: 227027
URL: http://svn.freebsd.org/changeset/base/227027

Log:
  off_t is POSIX, not C99.

Modified:
  user/des/sizes/sizes.c

Modified: user/des/sizes/sizes.c
==============================================================================
--- user/des/sizes/sizes.c	Wed Nov  2 19:06:01 2011	(r227026)
+++ user/des/sizes/sizes.c	Wed Nov  2 19:10:38 2011	(r227027)
@@ -96,7 +96,6 @@ sizes(void)
 	describe(long double);
 	describe(size_t);
 	describe(ptrdiff_t);
-	describe(off_t);
 	describe(time_t);
 	describe(void_ptr);
 	describe(func_ptr);

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 19:17:57 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 432041065670;
	Wed,  2 Nov 2011 19:17:57 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A6C18FC17;
	Wed,  2 Nov 2011 19:17:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2JHueU034697;
	Wed, 2 Nov 2011 19:17:56 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2JHu2R034695;
	Wed, 2 Nov 2011 19:17:56 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111021917.pA2JHu2R034695@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 19:17:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227028 - user/des/sizes
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 19:17:57 -0000

Author: des
Date: Wed Nov  2 19:17:56 2011
New Revision: 227028
URL: http://svn.freebsd.org/changeset/base/227028

Log:
  Add intmax_t.

Modified:
  user/des/sizes/sizes.c

Modified: user/des/sizes/sizes.c
==============================================================================
--- user/des/sizes/sizes.c	Wed Nov  2 19:10:38 2011	(r227027)
+++ user/des/sizes/sizes.c	Wed Nov  2 19:17:56 2011	(r227028)
@@ -91,6 +91,7 @@ sizes(void)
 	describe(int);
 	describe(long);
 	describe(long long);
+	describe(intmax_t);
 	describe(float);
 	describe(double);
 	describe(long double);

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 19:22:31 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 102DC106566C;
	Wed,  2 Nov 2011 19:22:31 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB6148FC0C;
	Wed,  2 Nov 2011 19:22:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2JMUrT034881;
	Wed, 2 Nov 2011 19:22:30 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2JMUPv034879;
	Wed, 2 Nov 2011 19:22:30 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111021922.pA2JMUPv034879@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 19:22:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227029 - user/des/sizes
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 19:22:31 -0000

Author: des
Date: Wed Nov  2 19:22:30 2011
New Revision: 227029
URL: http://svn.freebsd.org/changeset/base/227029

Log:
  Update copyright statement.

Modified:
  user/des/sizes/sizes.c

Modified: user/des/sizes/sizes.c
==============================================================================
--- user/des/sizes/sizes.c	Wed Nov  2 19:17:56 2011	(r227028)
+++ user/des/sizes/sizes.c	Wed Nov  2 19:22:30 2011	(r227029)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2009 Dag-Erling Coďdan Smřrgrav
+ * Copyright (c) 2008-2011 Dag-Erling Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

From owner-svn-src-user@FreeBSD.ORG  Wed Nov  2 19:35:32 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A3E71065674;
	Wed,  2 Nov 2011 19:35:32 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E57508FC16;
	Wed,  2 Nov 2011 19:35:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA2JZVwS035294;
	Wed, 2 Nov 2011 19:35:31 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA2JZVGP035292;
	Wed, 2 Nov 2011 19:35:31 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201111021935.pA2JZVGP035292@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 2 Nov 2011 19:35:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227030 - user/des/sizes
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Nov 2011 19:35:32 -0000

Author: des
Date: Wed Nov  2 19:35:31 2011
New Revision: 227030
URL: http://svn.freebsd.org/changeset/base/227030

Log:
  POSIXify the Makefile.

Modified:
  user/des/sizes/Makefile

Modified: user/des/sizes/Makefile
==============================================================================
--- user/des/sizes/Makefile	Wed Nov  2 19:22:30 2011	(r227029)
+++ user/des/sizes/Makefile	Wed Nov  2 19:35:31 2011	(r227030)
@@ -1,8 +1,12 @@
 # $FreeBSD$
 
-PROG	 = sizes
-CSTD	?= c99
-WARNS	?= 6
-MAN	 = # none
+.POSIX:
 
-.include 
+PROG	= sizes
+CC	= c99
+CFLAGS	= # none
+
+all: ${PROG}
+
+clean:
+	-rm ${PROG}

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 02:38:32 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9FB6E106564A;
	Thu,  3 Nov 2011 02:38:32 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7662B8FC16;
	Thu,  3 Nov 2011 02:38:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA32cW9Q049008;
	Thu, 3 Nov 2011 02:38:32 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA32cWCP049004;
	Thu, 3 Nov 2011 02:38:32 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030238.pA32cWCP049004@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 02:38:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227045 - in user/adrian/if_ath_tx/sys/dev/ath: .
	ath_hal ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 02:38:32 -0000

Author: adrian
Date: Thu Nov  3 02:38:32 2011
New Revision: 227045
URL: http://svn.freebsd.org/changeset/base/227045

Log:
  Add in a (temporary!) hack to allow the CCA to be forced.
  
  I'm seeing some very bizarre merlin behaviour where it thinks the
  air is > 95% busy, and thus never thinks the air is ready for TX.
  Comparing the RX clear / RX frame counters to Sowl (AR9160) show that
  they're decoding the same number of frames, but Merlin seems to
  calibrate the NF much, much lower than Sowl - and then thinks it
  can't TX for most of it.
  
  When I force the CCA to be the same as what Sowl sees (ie, ~ -85dB)
  then suddenly it thinks it can TX.
  
  I'll chase up _why_ this happens with the Atheros baseband/radio
  team.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h	Wed Nov  2 23:40:21 2011	(r227044)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h	Thu Nov  3 02:38:32 2011	(r227045)
@@ -780,6 +780,7 @@ typedef struct
 	int ah_dma_beacon_response_time;/* in TU's */
 	int ah_sw_beacon_response_time;	/* in TU's */
 	int ah_additional_swba_backoff;	/* in TU's */
+	int ah_cca;
 } HAL_OPS_CONFIG;
 
 /*

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Wed Nov  2 23:40:21 2011	(r227044)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu Nov  3 02:38:32 2011	(r227045)
@@ -627,6 +627,10 @@ ar5416LoadNF(struct ath_hal *ah, const s
 			else
 				nf_val = default_nf;
 
+			/* Override */
+			if (ah->ah_config.ah_cca != 0)
+				nf_val = ah->ah_config.ah_cca;
+
 			val = OS_REG_READ(ah, ar5416_cca_regs[i]);
 			val &= 0xFFFFFE00;
 			val |= (((uint32_t) nf_val << 1) & 0x1ff);

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c	Wed Nov  2 23:40:21 2011	(r227044)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c	Thu Nov  3 02:38:32 2011	(r227045)
@@ -893,4 +893,9 @@ ath_sysctl_hal_attach(struct ath_softc *
 	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "swba_backoff", CTLFLAG_RW,
 	    &sc->sc_ah->ah_config.ah_additional_swba_backoff, 0,
 	    "Atheros HAL additional SWBA backoff time");
+
+	sc->sc_ah->ah_config.ah_cca = 0;
+	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "cca", CTLFLAG_RW,
+	    &sc->sc_ah->ah_config.ah_cca, 0, "CCA override");
+
 }

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 02:48:15 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85175106564A;
	Thu,  3 Nov 2011 02:48:15 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 759C78FC08;
	Thu,  3 Nov 2011 02:48:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA32mFqo049345;
	Thu, 3 Nov 2011 02:48:15 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA32mFp1049343;
	Thu, 3 Nov 2011 02:48:15 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030248.pA32mFp1049343@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 02:48:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227046 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 02:48:15 -0000

Author: adrian
Date: Thu Nov  3 02:48:15 2011
New Revision: 227046
URL: http://svn.freebsd.org/changeset/base/227046

Log:
  Fix the ANI parameter count logic to properly explore all of the states.
  
  Since the values are "max", not "Number of items", using >= means that
  the last entry in each state would never be checked.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 02:38:32 2011	(r227045)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 02:48:15 2011	(r227046)
@@ -227,7 +227,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 		u_int level = param;
 
 		HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_NOISE_IMMUNITY_LEVEL: set level = %d\n", __func__, level);
-		if (level >= params->maxNoiseImmunityLevel) {
+		if (level > params->maxNoiseImmunityLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANI,
 			    "%s: immunity level out of range (%u > %u)\n",
 			    __func__, level, params->maxNoiseImmunityLevel);
@@ -314,7 +314,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 		u_int level = param;
 
 		HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_FIRSTEP_LEVEL: level = %d\n", __func__, level);
-		if (level >= params->maxFirstepLevel) {
+		if (level > params->maxFirstepLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANI,
 			    "%s: firstep level out of range (%u > %u)\n",
 			    __func__, level, params->maxFirstepLevel);
@@ -333,7 +333,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
 		u_int level = param;
 
 		HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_SPUR_IMMUNITY_LEVEL: level = %d\n", __func__, level);
-		if (level >= params->maxSpurImmunityLevel) {
+		if (level > params->maxSpurImmunityLevel) {
 			HALDEBUG(ah, HAL_DEBUG_ANI,
 			    "%s: spur immunity level out of range (%u > %u)\n",
 			    __func__, level, params->maxSpurImmunityLevel);

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 03:00:40 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 549E9106566C;
	Thu,  3 Nov 2011 03:00:40 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B4E78FC13;
	Thu,  3 Nov 2011 03:00:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA330exD049765;
	Thu, 3 Nov 2011 03:00:40 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA330eQL049763;
	Thu, 3 Nov 2011 03:00:40 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030300.pA330eQL049763@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 03:00:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227047 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 03:00:40 -0000

Author: adrian
Date: Thu Nov  3 03:00:39 2011
New Revision: 227047
URL: http://svn.freebsd.org/changeset/base/227047

Log:
  ANI fixes, inspired by the Atheros reference code.
  
  * Since some items may be disabled or out of range, don't stop trying
    once a value is modified. The call to ar5416AniControl() may fail
    because the value is disabled or out of range, so fall through to
    the next value.
  
  * If in hostap mode, the beacon-RSSI-based logic for ANI twiddling
    can't be used, so instead just step firstep up to max.
  
  Although this change doesn't currently implement it, winding up
  firstep manually up to 16 (which isn't done here) does quieten
  most of the residual CCK/OFDM errors in hostap mode in a busy
  2.4ghz environment. I won't commit that (yet) until I've tested it
  with real traffic.
  
  Obtained from:	Atheros

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 02:48:15 2011	(r227046)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 03:00:39 2011	(r227047)
@@ -384,20 +384,31 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 	aniState = ahp->ah_curani;
 	params = aniState->params;
 	/* First, raise noise immunity level, up to max */
-	if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL)) &&
-	    (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) {
-		ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, 
-				 aniState->noiseImmunityLevel + 1);
+	if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) {
+		if (ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, 
+				 aniState->noiseImmunityLevel + 1))
 		return;
 	}
 	/* then, raise spur immunity level, up to max */
-	if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL)) &&
-	    (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) {
-		ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
-				 aniState->spurImmunityLevel + 1);
+	if (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel) {
+		if (ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
+				 aniState->spurImmunityLevel + 1))
 		return;
 	}
 
+	/*
+	 * In the case of AP mode operation, we cannot bucketize beacons
+	 * according to RSSI.  Instead, raise Firstep level, up to max, and
+	 * simply return.
+	 */
+	if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) {
+		if (aniState->firstepLevel < params->maxFirstepLevel) {
+			if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+			    aniState->firstepLevel + 1))
+				return;
+		}
+	}
+
 	if (ANI_ENA_RSSI(ah)) {
 		int32_t rssi = BEACON_RSSI(ahp);
 		if (rssi > params->rssiThrHigh) {
@@ -418,8 +429,8 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 			 * raise firstep level 
 			 */
 			if (aniState->firstepLevel+1 < params->maxFirstepLevel) {
-				ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
-						 aniState->firstepLevel + 1);
+				if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+						 aniState->firstepLevel + 1))
 				return;
 			}
 		} else if (rssi > params->rssiThrLow) {
@@ -432,9 +443,9 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 				    HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION,
 				    AH_TRUE);
 			if (aniState->firstepLevel+1 < params->maxFirstepLevel)
-				ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
-				     aniState->firstepLevel + 1);
-			return;
+				if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+				     aniState->firstepLevel + 1))
+				return;
 		} else {
 			/* 
 			 * Beacon rssi is low, if in 11b/g mode, turn off ofdm
@@ -447,8 +458,8 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 					    HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION,
 					    AH_FALSE);
 				if (aniState->firstepLevel > 0)
-					ar5416AniControl(ah,
-					     HAL_ANI_FIRSTEP_LEVEL, 0);
+					(ar5416AniControl(ah,
+					     HAL_ANI_FIRSTEP_LEVEL, 0));
 				return;
 			}
 		}

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 03:07:42 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3199F1065672;
	Thu,  3 Nov 2011 03:07:42 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 21EA18FC0C;
	Thu,  3 Nov 2011 03:07:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA337gD6050125;
	Thu, 3 Nov 2011 03:07:42 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA337g4E050123;
	Thu, 3 Nov 2011 03:07:42 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030307.pA337g4E050123@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 03:07:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227048 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 03:07:42 -0000

Author: adrian
Date: Thu Nov  3 03:07:41 2011
New Revision: 227048
URL: http://svn.freebsd.org/changeset/base/227048

Log:
  Begin some dirty hacks to implement channel survey support and unify
  some of the MIB counter access.
  
  The reference HAL has a handful of routines which fondle the MIB
  registers. This commit modifies the ar5416AniGetListenTime() to use
  ar5416GetMibCycleCountsPct() which grabs the TX/RX/RC counters and
  returns the percentage of time the channel is busy. This way it doesn't
  also do its own register reading.
  
  The last values are cached in the ath_hal state, so they can be used
  by other parts of the code. This will (eventually) include channel
  survey support, which will keep a per-channel history of these values.
  
  Also - run this every ANI interval, whether it's enabled or not.
  The listen time routine should be modified to not use ANI state at all
  so it can be called if it's disabled without the fear of aniState
  being NULL, but that can come in a subsequent commit.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 03:00:39 2011	(r227047)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 03:07:41 2011	(r227048)
@@ -793,15 +793,15 @@ ar5416AniGetListenTime(struct ath_hal *a
 {
 	struct ath_hal_5212 *ahp = AH5212(ah);
 	struct ar5212AniState *aniState;
-	uint32_t txFrameCount, rxFrameCount, cycleCount;
+	uint32_t rxc_pct, extc_pct, rxf_pct, txf_pct;
 	int32_t listenTime;
+	int good;
 
-	txFrameCount = OS_REG_READ(ah, AR_TFCNT);
-	rxFrameCount = OS_REG_READ(ah, AR_RFCNT);
-	cycleCount = OS_REG_READ(ah, AR_CCCNT);
+	good = ar5416GetMibCycleCountsPct(ah,
+	&rxc_pct, &extc_pct, &rxf_pct, &txf_pct);
 
 	aniState = ahp->ah_curani;
-	if (aniState->cycleCount == 0 || aniState->cycleCount > cycleCount) {
+	if (good == 0) {
 		/*
 		 * Cycle counter wrap (or initial call); it's not possible
 		 * to accurately calculate a value because the registers
@@ -810,14 +810,18 @@ ar5416AniGetListenTime(struct ath_hal *a
 		listenTime = 0;
 		ahp->ah_stats.ast_ani_lzero++;
 	} else {
-		int32_t ccdelta = cycleCount - aniState->cycleCount;
-		int32_t rfdelta = rxFrameCount - aniState->rxFrameCount;
-		int32_t tfdelta = txFrameCount - aniState->txFrameCount;
+		int32_t ccdelta = AH5416(ah)->ah_cycleCount - aniState->cycleCount;
+		int32_t rfdelta = AH5416(ah)->ah_rxBusy - aniState->rxFrameCount;
+		int32_t tfdelta = AH5416(ah)->ah_txBusy - aniState->txFrameCount;
 		listenTime = (ccdelta - rfdelta - tfdelta) / CLOCK_RATE;
 	}
-	aniState->cycleCount = cycleCount;
-	aniState->txFrameCount = txFrameCount;
-	aniState->rxFrameCount = rxFrameCount;
+	aniState->cycleCount = AH5416(ah)->ah_cycleCount;
+	aniState->txFrameCount = AH5416(ah)->ah_rxBusy;
+	aniState->rxFrameCount = AH5416(ah)->ah_txBusy;
+
+	HALDEBUG(ah, HAL_DEBUG_ANI, "rxc=%d, extc=%d, rxf=%d, txf=%d\n",
+	    rxc_pct, extc_pct, rxf_pct, txf_pct);
+
 	return listenTime;
 }
 
@@ -884,10 +888,13 @@ ar5416AniPoll(struct ath_hal *ah, const 
 	/* XXX can aniState be null? */
 	if (aniState == AH_NULL)
 		return;
+
+	/* Always update from the MIB, for statistics gathering */
+	listenTime = ar5416AniGetListenTime(ah);
+
 	if (!ANI_ENA(ah))
 		return;
 
-	listenTime = ar5416AniGetListenTime(ah);
 	if (listenTime < 0) {
 		ahp->ah_stats.ast_ani_lneg++;
 		/* restart ANI period if listenTime is invalid */

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 04:18:34 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F417106566C;
	Thu,  3 Nov 2011 04:18:34 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E9D0B8FC15;
	Thu,  3 Nov 2011 04:18:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA34IXbH052408;
	Thu, 3 Nov 2011 04:18:33 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA34IXUJ052406;
	Thu, 3 Nov 2011 04:18:33 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030418.pA34IXUJ052406@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 04:18:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227049 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 04:18:34 -0000

Author: adrian
Date: Thu Nov  3 04:18:33 2011
New Revision: 227049
URL: http://svn.freebsd.org/changeset/base/227049

Log:
  Add the other half of the ANI changes - when lowering immunity -
  
  * if in hostap mode, lower firstep first;
  * just skip ani control modifications that fail and fall through to
    the next one, so the ANI code doesn't get "stuck" on a level change
    that can't occur.
  
  Obtained from:	Atheros

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 03:07:41 2011	(r227048)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Thu Nov  3 04:18:33 2011	(r227049)
@@ -726,6 +726,19 @@ ar5416AniLowerImmunity(struct ath_hal *a
 
 	aniState = ahp->ah_curani;
 	params = aniState->params;
+
+	/*
+	 * In the case of AP mode operation, we cannot bucketize beacons
+	 * according to RSSI.  Instead, lower Firstep level, down to min, and
+	 * simply return.
+	 */
+	if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) {
+		if (aniState->firstepLevel > 0) {
+			if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+			    aniState->firstepLevel - 1))
+				return;
+		}
+	}
 	if (ANI_ENA_RSSI(ah)) {
 		int32_t rssi = BEACON_RSSI(ahp);
 		if (rssi > params->rssiThrHigh) {
@@ -740,41 +753,41 @@ ar5416AniLowerImmunity(struct ath_hal *a
 			 * detection or lower firstep level.
 			 */
 			if (aniState->ofdmWeakSigDetectOff) {
-				ar5416AniControl(ah,
+				if (ar5416AniControl(ah,
 				    HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION,
-				    AH_TRUE);
-				return;
+				    AH_TRUE))
+					return;
 			}
 			if (aniState->firstepLevel > 0) {
-				ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
-						 aniState->firstepLevel - 1);
-				return;
+				if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+						 aniState->firstepLevel - 1))
+					return;
 			}
 		} else {
 			/*
 			 * Beacon rssi is low, reduce firstep level.
 			 */
 			if (aniState->firstepLevel > 0) {
-				ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
-						 aniState->firstepLevel - 1);
-				return;
+				if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
+						 aniState->firstepLevel - 1))
+					return;
 			}
 		}
 	}
 	/* then lower spur immunity level, down to zero */
 	if (aniState->spurImmunityLevel > 0) {
-		ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
-				 aniState->spurImmunityLevel - 1);
-		return;
+		if (ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
+				 aniState->spurImmunityLevel - 1))
+			return;
 	}
 	/* 
 	 * if all else fails, lower noise immunity level down to a min value
 	 * zero for now
 	 */
 	if (aniState->noiseImmunityLevel > 0) {
-		ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
-				 aniState->noiseImmunityLevel - 1);
-		return;
+		if (ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
+				 aniState->noiseImmunityLevel - 1))
+			return;
 	}
 }
 

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 04:36:05 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23ECC106566B;
	Thu,  3 Nov 2011 04:36:05 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 13DF48FC14;
	Thu,  3 Nov 2011 04:36:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA34a4Lk052977;
	Thu, 3 Nov 2011 04:36:04 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA34a4CU052975;
	Thu, 3 Nov 2011 04:36:04 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030436.pA34a4CU052975@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 04:36:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227050 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 04:36:05 -0000

Author: adrian
Date: Thu Nov  3 04:36:04 2011
New Revision: 227050
URL: http://svn.freebsd.org/changeset/base/227050

Log:
  Flip back to the default, just to see how this works for users.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu Nov  3 04:18:33 2011	(r227049)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu Nov  3 04:36:04 2011	(r227050)
@@ -646,15 +646,7 @@ ar5416LoadNF(struct ath_hal *ah, const s
 	OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
 
 	/* Wait for load to complete, should be fast, a few 10s of us. */
-	/*
-	 * XXX For now, don't be so aggressive in waiting for the NF
-	 * XXX load to complete. A very busy 11n RX load will cause this
-	 * XXX to always fail; so just leave it.
-	 * XXX Later on we may wish to split longcal into two parts - one to do
-	 * XXX the initial longcal, and one to load in an updated NF value
-	 * XXX once it's finished - say, by checking it every 500ms.
-	 */
-	if (! ar5212WaitNFCalComplete(ah, 5)) {
+	if (! ar5212WaitNFCalComplete(ah, 1000)) {
 		/*
 		 * We timed out waiting for the noisefloor to load, probably due to an
 		 * in-progress rx. Simply return here and allow the load plenty of time

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 05:08:25 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 88C9F106566C;
	Thu,  3 Nov 2011 05:08:25 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 03FD88FC17;
	Thu,  3 Nov 2011 05:08:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA358Oxn054044;
	Thu, 3 Nov 2011 05:08:24 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA358OEs054042;
	Thu, 3 Nov 2011 05:08:24 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030508.pA358OEs054042@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 05:08:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227051 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 05:08:25 -0000

Author: adrian
Date: Thu Nov  3 05:08:24 2011
New Revision: 227051
URL: http://svn.freebsd.org/changeset/base/227051

Log:
  To help in debugging, always print out these failures.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu Nov  3 04:36:04 2011	(r227050)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Thu Nov  3 05:08:24 2011	(r227051)
@@ -217,7 +217,7 @@ ar5416InitCalHardware(struct ath_hal *ah
 
 	/* Poll for offset calibration complete */
 	if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) {
-		HALDEBUG(ah, HAL_DEBUG_ANY,
+		HALDEBUG(ah, HAL_DEBUG_UNMASKABLE,
 		    "%s: offset calibration did not complete in 1ms; "
 		    "noisy environment?\n", __func__);
 		return AH_FALSE;
@@ -251,7 +251,7 @@ ar5416InitCal(struct ath_hal *ah, const 
 
 	/* Do initial chipset-specific calibration */
 	if (! AH5416(ah)->ah_cal_initcal(ah, chan)) {
-		HALDEBUG(ah, HAL_DEBUG_ANY,
+		HALDEBUG(ah, HAL_DEBUG_UNMASKABLE,
 		    "%s: initial chipset calibration did "
 		    "not complete in time; noisy environment?\n", __func__);
 		return AH_FALSE;
@@ -656,7 +656,7 @@ ar5416LoadNF(struct ath_hal *ah, const s
 		 * here, the baseband nf cal will just be capped by our present
 		 * noisefloor until the next calibration timer.
 		 */
-		HALDEBUG(ah, HAL_DEBUG_NFCAL, "Timeout while waiting for "
+		HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "Timeout while waiting for "
 		    "nf to load: AR_PHY_AGC_CONTROL=0x%x\n",
 		    OS_REG_READ(ah, AR_PHY_AGC_CONTROL));
 		return;

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 05:27:20 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C037106564A;
	Thu,  3 Nov 2011 05:27:20 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 425F18FC13;
	Thu,  3 Nov 2011 05:27:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA35RKxd054631;
	Thu, 3 Nov 2011 05:27:20 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA35RKhj054629;
	Thu, 3 Nov 2011 05:27:20 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030527.pA35RKhj054629@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 05:27:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227052 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 05:27:20 -0000

Author: adrian
Date: Thu Nov  3 05:27:19 2011
New Revision: 227052
URL: http://svn.freebsd.org/changeset/base/227052

Log:
  Some reset path changes, just to unify things with the Atheros HAL.
  
  * If the MAC is asleep, force it awake and _stay_ awake whilst the reset
    is done. Otherwise it may go back to sleep during the reset phase.
    This won't happen at the moment since people aren't (shouldn't!) be using
    MAC power saving in my 11n branch.
  
  * Add some further comments to describe what's going on.
  
  Obtained from:	Atheros

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Nov  3 05:08:24 2011	(r227051)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Nov  3 05:27:19 2011	(r227052)
@@ -1209,6 +1209,13 @@ ar5416PhyDisable(struct ath_hal *ah)
 HAL_BOOL
 ar5416SetResetReg(struct ath_hal *ah, uint32_t type)
 {
+
+	/*
+	 * Set force wake
+	 */
+	OS_REG_WRITE(ah, AR_RTC_FORCE_WAKE,
+	    AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT);
+
 	switch (type) {
 	case HAL_RESET_POWER_ON:
 		return ar5416SetResetPowerOn(ah);
@@ -1239,10 +1246,16 @@ ar5416SetResetPowerOn(struct ath_hal *ah
             AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT);    
 
     /*
-     * RTC reset and clear
+     * PowerOn reset can be used in open loop power control or failure recovery.
+     * If we do RTC reset while DMA is still running, hardware may corrupt memory.
+     * Therefore, we need to reset AHB first to stop DMA.
      */
     if (! AR_SREV_HOWL(ah))
     	OS_REG_WRITE(ah, AR_RC, AR_RC_AHB);
+
+    /*
+     * RTC reset and clear
+     */
     OS_REG_WRITE(ah, AR_RTC_RESET, 0);
     OS_DELAY(20);
 
@@ -1293,6 +1306,11 @@ ar5416SetReset(struct ath_hal *ah, int t
 #endif	/* AH_SUPPORT_AR9130 */
         /*
          * Reset AHB
+	 *
+	 * (In case the last interrupt source was a bus timeout.)
+	 * XXX TODO: this is not the way to do it! It should be recorded
+	 * XXX by the interrupt handler and passed _into_ the
+	 * XXX reset path routine so this occurs.
          */
         tmpReg = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
         if (tmpReg & (AR_INTR_SYNC_LOCAL_TIMEOUT|AR_INTR_SYNC_RADM_CPL_TIMEOUT)) {

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 05:35:32 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55A84106564A;
	Thu,  3 Nov 2011 05:35:32 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B3AF8FC16;
	Thu,  3 Nov 2011 05:35:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA35ZWFn054916;
	Thu, 3 Nov 2011 05:35:32 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA35ZWhZ054909;
	Thu, 3 Nov 2011 05:35:32 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030535.pA35ZWhZ054909@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 05:35:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227053 - in user/adrian/if_ath_tx/sys/dev/ath/ath_hal:
	ar5416 ar9001 ar9002
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 05:35:32 -0000

Author: adrian
Date: Thu Nov  3 05:35:31 2011
New Revision: 227053
URL: http://svn.freebsd.org/changeset/base/227053

Log:
  The Atheros HAL does a PLL init pass during startup. Do the same here.
  
  Obtained from:	Atheros

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -274,6 +274,8 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n", __func__);
 		ecode = HAL_EIO;

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -135,6 +135,8 @@ ar9130Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
 		    __func__);

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -156,6 +156,8 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
 		    __func__);

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -199,6 +199,8 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
 		    __func__);

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -164,6 +164,8 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, AH_NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
 		    __func__);

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c	Thu Nov  3 05:27:19 2011	(r227052)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c	Thu Nov  3 05:35:31 2011	(r227053)
@@ -176,6 +176,8 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	AH5416(ah)->ah_initPLL(ah, NULL);
+
 	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
 		    __func__);

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 05:44:00 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 912C4106566B;
	Thu,  3 Nov 2011 05:44:00 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 80F3C8FC17;
	Thu,  3 Nov 2011 05:44:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA35i0DS055183;
	Thu, 3 Nov 2011 05:44:00 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA35i0Ut055179;
	Thu, 3 Nov 2011 05:44:00 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111030544.pA35i0Ut055179@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Nov 2011 05:44:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227054 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 05:44:00 -0000

Author: adrian
Date: Thu Nov  3 05:44:00 2011
New Revision: 227054
URL: http://svn.freebsd.org/changeset/base/227054

Log:
  Add a PLL init call, matching what the reference driver does when
  waking up the NIC after a total shutdown.
  
  Obtained from:	Atheros

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_power.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Thu Nov  3 05:35:31 2011	(r227053)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Thu Nov  3 05:44:00 2011	(r227054)
@@ -36,7 +36,7 @@
 static HAL_BOOL
 ar5416SetPowerModeAwake(struct ath_hal *ah, int setChip)
 {
-#define	POWER_UP_TIME	200000
+#define	POWER_UP_TIME	10000
 	uint32_t val;
 	int i = 0;
 
@@ -50,6 +50,7 @@ ar5416SetPowerModeAwake(struct ath_hal *
 			& AR_RTC_PM_STATUS_M) == AR_RTC_STATUS_SHUTDOWN) {
 			if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
 				goto bad;			
+			ar5416InitPLL(ah, AH_NULL);
 		}
 
 		if (AR_SREV_HOWL(ah))

From owner-svn-src-user@FreeBSD.ORG  Thu Nov  3 21:57:03 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 042CD1065672;
	Thu,  3 Nov 2011 21:57:03 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E45E18FC13;
	Thu,  3 Nov 2011 21:57:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA3Lv2Ea088446;
	Thu, 3 Nov 2011 21:57:02 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA3Lv2v1088421;
	Thu, 3 Nov 2011 21:57:02 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201111032157.pA3Lv2v1088421@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 3 Nov 2011 21:57:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227066 - in user/attilio/vmcontention: . contrib/top
	lib/libc/amd64/gen lib/libc/i386/gen
	lib/libpam/modules/pam_unix share/man/man4 share/misc
	share/mk sys/amd64/conf sys/arm/conf sys...
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Nov 2011 21:57:03 -0000

Author: attilio
Date: Thu Nov  3 21:57:02 2011
New Revision: 227066
URL: http://svn.freebsd.org/changeset/base/227066

Log:
  MFC

Added:
  user/attilio/vmcontention/share/man/man4/qlxgb.4
     - copied unchanged from r227065, head/share/man/man4/qlxgb.4
  user/attilio/vmcontention/sys/dev/esp/am53c974reg.h
     - copied unchanged from r227065, head/sys/dev/esp/am53c974reg.h
  user/attilio/vmcontention/sys/dev/esp/esp_pci.c
     - copied unchanged from r227065, head/sys/dev/esp/esp_pci.c
  user/attilio/vmcontention/sys/dev/mii/mii_bitbang.c
     - copied unchanged from r227065, head/sys/dev/mii/mii_bitbang.c
  user/attilio/vmcontention/sys/dev/mii/mii_bitbang.h
     - copied unchanged from r227065, head/sys/dev/mii/mii_bitbang.h
  user/attilio/vmcontention/sys/dev/qlxgb/
     - copied from r227065, head/sys/dev/qlxgb/
  user/attilio/vmcontention/sys/modules/qlxgb/
     - copied from r227065, head/sys/modules/qlxgb/
Modified:
  user/attilio/vmcontention/UPDATING
  user/attilio/vmcontention/lib/libc/amd64/gen/setjmp.S
  user/attilio/vmcontention/lib/libc/amd64/gen/sigsetjmp.S
  user/attilio/vmcontention/lib/libc/i386/gen/setjmp.S
  user/attilio/vmcontention/lib/libc/i386/gen/sigsetjmp.S
  user/attilio/vmcontention/lib/libpam/modules/pam_unix/pam_unix.8
  user/attilio/vmcontention/share/man/man4/Makefile
  user/attilio/vmcontention/share/misc/bsd-family-tree
  user/attilio/vmcontention/sys/amd64/conf/GENERIC
  user/attilio/vmcontention/sys/arm/conf/GUMSTIX
  user/attilio/vmcontention/sys/boot/common/loader.8
  user/attilio/vmcontention/sys/conf/NOTES
  user/attilio/vmcontention/sys/conf/files
  user/attilio/vmcontention/sys/conf/files.amd64
  user/attilio/vmcontention/sys/dev/ata/ata-pci.c
  user/attilio/vmcontention/sys/dev/ata/chipsets/ata-promise.c
  user/attilio/vmcontention/sys/dev/ata/chipsets/ata-siliconimage.c
  user/attilio/vmcontention/sys/dev/bm/if_bm.c
  user/attilio/vmcontention/sys/dev/bm/if_bmreg.h
  user/attilio/vmcontention/sys/dev/bm/if_bmvar.h
  user/attilio/vmcontention/sys/dev/dc/if_dc.c
  user/attilio/vmcontention/sys/dev/dc/if_dcreg.h
  user/attilio/vmcontention/sys/dev/mpt/mpt.c
  user/attilio/vmcontention/sys/dev/nge/if_nge.c
  user/attilio/vmcontention/sys/dev/nge/if_ngereg.h
  user/attilio/vmcontention/sys/dev/re/if_re.c
  user/attilio/vmcontention/sys/dev/sis/if_sis.c
  user/attilio/vmcontention/sys/dev/sis/if_sisreg.h
  user/attilio/vmcontention/sys/dev/smc/if_smc.c
  user/attilio/vmcontention/sys/dev/ste/if_ste.c
  user/attilio/vmcontention/sys/dev/ste/if_stereg.h
  user/attilio/vmcontention/sys/dev/stge/if_stge.c
  user/attilio/vmcontention/sys/dev/stge/if_stgereg.h
  user/attilio/vmcontention/sys/dev/tl/if_tl.c
  user/attilio/vmcontention/sys/dev/tl/if_tlreg.h
  user/attilio/vmcontention/sys/dev/uart/uart_dev_ns8250.c
  user/attilio/vmcontention/sys/dev/wb/if_wb.c
  user/attilio/vmcontention/sys/dev/wb/if_wbreg.h
  user/attilio/vmcontention/sys/dev/xl/if_xl.c
  user/attilio/vmcontention/sys/dev/xl/if_xlreg.h
  user/attilio/vmcontention/sys/fs/devfs/devfs_vnops.c
  user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c
  user/attilio/vmcontention/sys/geom/concat/g_concat.c
  user/attilio/vmcontention/sys/geom/concat/g_concat.h
  user/attilio/vmcontention/sys/geom/geom_dev.c
  user/attilio/vmcontention/sys/geom/geom_event.c
  user/attilio/vmcontention/sys/geom/geom_vfs.c
  user/attilio/vmcontention/sys/geom/stripe/g_stripe.c
  user/attilio/vmcontention/sys/i386/conf/GENERIC
  user/attilio/vmcontention/sys/kern/subr_smp.c
  user/attilio/vmcontention/sys/mips/mips/pmap.c
  user/attilio/vmcontention/sys/modules/Makefile
  user/attilio/vmcontention/sys/modules/esp/Makefile
  user/attilio/vmcontention/sys/modules/mii/Makefile
  user/attilio/vmcontention/sys/net/rtsock.c
  user/attilio/vmcontention/sys/netinet/tcp_input.c
  user/attilio/vmcontention/sys/netinet/tcp_output.c
  user/attilio/vmcontention/sys/netinet6/icmp6.c
  user/attilio/vmcontention/sys/pc98/conf/GENERIC
  user/attilio/vmcontention/sys/pci/if_rl.c
  user/attilio/vmcontention/sys/pci/if_rlreg.h
  user/attilio/vmcontention/sys/rpc/clnt_dg.c
  user/attilio/vmcontention/sys/sparc64/conf/GENERIC
  user/attilio/vmcontention/sys/vm/vm_page.c
  user/attilio/vmcontention/usr.sbin/mergemaster/mergemaster.8
  user/attilio/vmcontention/usr.sbin/mergemaster/mergemaster.sh
  user/attilio/vmcontention/usr.sbin/pmcstat/pmcstat.c
  user/attilio/vmcontention/usr.sbin/tzsetup/tzsetup.c
Directory Properties:
  user/attilio/vmcontention/   (props changed)
  user/attilio/vmcontention/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/contrib/bind9/   (props changed)
  user/attilio/vmcontention/contrib/binutils/   (props changed)
  user/attilio/vmcontention/contrib/bzip2/   (props changed)
  user/attilio/vmcontention/contrib/com_err/   (props changed)
  user/attilio/vmcontention/contrib/compiler-rt/   (props changed)
  user/attilio/vmcontention/contrib/dialog/   (props changed)
  user/attilio/vmcontention/contrib/ee/   (props changed)
  user/attilio/vmcontention/contrib/expat/   (props changed)
  user/attilio/vmcontention/contrib/file/   (props changed)
  user/attilio/vmcontention/contrib/gcc/   (props changed)
  user/attilio/vmcontention/contrib/gdb/   (props changed)
  user/attilio/vmcontention/contrib/gdtoa/   (props changed)
  user/attilio/vmcontention/contrib/gnu-sort/   (props changed)
  user/attilio/vmcontention/contrib/groff/   (props changed)
  user/attilio/vmcontention/contrib/less/   (props changed)
  user/attilio/vmcontention/contrib/libpcap/   (props changed)
  user/attilio/vmcontention/contrib/libstdc++/   (props changed)
  user/attilio/vmcontention/contrib/llvm/   (props changed)
  user/attilio/vmcontention/contrib/llvm/tools/clang/   (props changed)
  user/attilio/vmcontention/contrib/ncurses/   (props changed)
  user/attilio/vmcontention/contrib/netcat/   (props changed)
  user/attilio/vmcontention/contrib/ntp/   (props changed)
  user/attilio/vmcontention/contrib/one-true-awk/   (props changed)
  user/attilio/vmcontention/contrib/openbsm/   (props changed)
  user/attilio/vmcontention/contrib/openpam/   (props changed)
  user/attilio/vmcontention/contrib/openresolv/   (props changed)
  user/attilio/vmcontention/contrib/pf/   (props changed)
  user/attilio/vmcontention/contrib/sendmail/   (props changed)
  user/attilio/vmcontention/contrib/tcpdump/   (props changed)
  user/attilio/vmcontention/contrib/tcsh/   (props changed)
  user/attilio/vmcontention/contrib/tnftp/   (props changed)
  user/attilio/vmcontention/contrib/top/   (props changed)
  user/attilio/vmcontention/contrib/top/install-sh   (props changed)
  user/attilio/vmcontention/contrib/tzcode/stdtime/   (props changed)
  user/attilio/vmcontention/contrib/tzcode/zic/   (props changed)
  user/attilio/vmcontention/contrib/tzdata/   (props changed)
  user/attilio/vmcontention/contrib/wpa/   (props changed)
  user/attilio/vmcontention/contrib/xz/   (props changed)
  user/attilio/vmcontention/crypto/heimdal/   (props changed)
  user/attilio/vmcontention/crypto/openssh/   (props changed)
  user/attilio/vmcontention/crypto/openssl/   (props changed)
  user/attilio/vmcontention/gnu/lib/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/binutils/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/gdb/   (props changed)
  user/attilio/vmcontention/lib/libc/   (props changed)
  user/attilio/vmcontention/lib/libc/stdtime/   (props changed)
  user/attilio/vmcontention/lib/libutil/   (props changed)
  user/attilio/vmcontention/lib/libz/   (props changed)
  user/attilio/vmcontention/sbin/   (props changed)
  user/attilio/vmcontention/sbin/ipfw/   (props changed)
  user/attilio/vmcontention/share/mk/bsd.arch.inc.mk   (props changed)
  user/attilio/vmcontention/share/zoneinfo/   (props changed)
  user/attilio/vmcontention/sys/   (props changed)
  user/attilio/vmcontention/sys/amd64/include/xen/   (props changed)
  user/attilio/vmcontention/sys/boot/   (props changed)
  user/attilio/vmcontention/sys/boot/i386/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/ski/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/ofw/   (props changed)
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/sys/conf/   (props changed)
  user/attilio/vmcontention/sys/contrib/dev/acpica/   (props changed)
  user/attilio/vmcontention/sys/contrib/octeon-sdk/   (props changed)
  user/attilio/vmcontention/sys/contrib/pf/   (props changed)
  user/attilio/vmcontention/sys/contrib/x86emu/   (props changed)
  user/attilio/vmcontention/usr.bin/calendar/   (props changed)
  user/attilio/vmcontention/usr.bin/csup/   (props changed)
  user/attilio/vmcontention/usr.bin/procstat/   (props changed)
  user/attilio/vmcontention/usr.sbin/ndiscvt/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvctl/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvd/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtsold/   (props changed)
  user/attilio/vmcontention/usr.sbin/zic/   (props changed)

Modified: user/attilio/vmcontention/UPDATING
==============================================================================
--- user/attilio/vmcontention/UPDATING	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/UPDATING	Thu Nov  3 21:57:02 2011	(r227066)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20111101:
+	The broken amd(4) driver has been replaced with esp(4) in the amd64,
+	i386 and pc98 GENERIC kernel configuration files.
+
 20110930:
 	sysinstall has been removed
 

Modified: user/attilio/vmcontention/lib/libc/amd64/gen/setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/amd64/gen/setjmp.S	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/lib/libc/amd64/gen/setjmp.S	Thu Nov  3 21:57:02 2011	(r227066)
@@ -54,6 +54,7 @@ ENTRY(setjmp)
 	movq	$1,%rdi			/* SIG_BLOCK       */
 	movq	$0,%rsi			/* (sigset_t*)set  */
 	leaq	72(%rcx),%rdx		/* 9,10; (sigset_t*)oset */
+	/* stack is 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
 	popq	%rdi
 	movq	%rdi,%rcx
@@ -81,7 +82,9 @@ ENTRY(__longjmp)
 	movq	$3,%rdi			/* SIG_SETMASK     */
 	leaq	72(%rdx),%rsi		/* (sigset_t*)set  */
 	movq	$0,%rdx			/* (sigset_t*)oset */
+	subq	$0x8,%rsp		/* make the stack 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
+	addq	$0x8,%rsp
 	popq	%rsi
 	popq	%rdi			/* jmpbuf */
 	movq	%rdi,%rdx

Modified: user/attilio/vmcontention/lib/libc/amd64/gen/sigsetjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/amd64/gen/sigsetjmp.S	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/lib/libc/amd64/gen/sigsetjmp.S	Thu Nov  3 21:57:02 2011	(r227066)
@@ -62,6 +62,7 @@ ENTRY(sigsetjmp)
 	movq	$1,%rdi			/* SIG_BLOCK       */
 	movq	$0,%rsi			/* (sigset_t*)set  */
 	leaq	72(%rcx),%rdx		/* 9,10 (sigset_t*)oset */
+	/* stack is 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
 	popq	%rdi
 2:	movq	%rdi,%rcx
@@ -90,7 +91,9 @@ ENTRY(__siglongjmp)
 	movq	$3,%rdi			/* SIG_SETMASK     */
 	leaq	72(%rdx),%rsi		/* (sigset_t*)set  */
 	movq	$0,%rdx			/* (sigset_t*)oset */
+	subq	$0x8,%rsp		/* make the stack 16-byte aligned */
 	call	PIC_PLT(CNAME(_sigprocmask))
+	addq	$0x8,%rsp
 	popq	%rsi
 	popq	%rdi			/* jmpbuf */
 2:	movq	%rdi,%rdx

Modified: user/attilio/vmcontention/lib/libc/i386/gen/setjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/i386/gen/setjmp.S	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/lib/libc/i386/gen/setjmp.S	Thu Nov  3 21:57:02 2011	(r227066)
@@ -51,12 +51,19 @@ __FBSDID("$FreeBSD$");
 ENTRY(setjmp)
 	movl	4(%esp),%ecx
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	leal	28(%ecx), %eax
 	pushl	%eax			/* (sigset_t*)oset */
 	pushl	$0			/* (sigset_t*)set  */
 	pushl	$1			/* SIG_BLOCK       */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%ecx
 	movl	0(%esp),%edx
@@ -76,12 +83,19 @@ END(setjmp)
 ENTRY(__longjmp)
 	movl	4(%esp),%edx
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	pushl	$0			/* (sigset_t*)oset */
 	leal	28(%edx), %eax
 	pushl	%eax			/* (sigset_t*)set  */
 	pushl	$3			/* SIG_SETMASK     */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%edx
 	movl	8(%esp),%eax

Modified: user/attilio/vmcontention/lib/libc/i386/gen/sigsetjmp.S
==============================================================================
--- user/attilio/vmcontention/lib/libc/i386/gen/sigsetjmp.S	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/lib/libc/i386/gen/sigsetjmp.S	Thu Nov  3 21:57:02 2011	(r227066)
@@ -60,12 +60,19 @@ ENTRY(sigsetjmp)
 	testl	%eax,%eax
 	jz	2f
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	leal	28(%ecx), %eax
 	pushl	%eax			/* (sigset_t*)oset */
 	pushl	$0			/* (sigset_t*)set  */
 	pushl	$1			/* SIG_BLOCK       */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%ecx
 2:	movl	0(%esp),%edx
@@ -87,12 +94,19 @@ ENTRY(__siglongjmp)
 	cmpl	$0,44(%edx)
 	jz	2f
 	PIC_PROLOGUE
+#ifdef PIC
+	subl	$12,%esp		/* make the stack 16-byte aligned */
+#endif
 	pushl	$0			/* (sigset_t*)oset */
 	leal	28(%edx), %eax
 	pushl	%eax			/* (sigset_t*)set  */
 	pushl	$3			/* SIG_SETMASK     */
 	call	PIC_PLT(CNAME(_sigprocmask))
+#ifdef PIC
+	addl	$24,%esp
+#else
 	addl	$12,%esp
+#endif
 	PIC_EPILOGUE
 	movl	4(%esp),%edx
 2:	movl	8(%esp),%eax

Modified: user/attilio/vmcontention/lib/libpam/modules/pam_unix/pam_unix.8
==============================================================================
--- user/attilio/vmcontention/lib/libpam/modules/pam_unix/pam_unix.8	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/lib/libpam/modules/pam_unix/pam_unix.8	Thu Nov  3 21:57:02 2011	(r227066)
@@ -199,3 +199,9 @@ password database.
 .Xr pam 8 ,
 .Xr pw 8 ,
 .Xr yp 8
+.Sh BUGS
+The
+.Nm
+module ignores the
+.Dv PAM_CHANGE_EXPIRED_AUTHTOK
+flag.

Modified: user/attilio/vmcontention/share/man/man4/Makefile
==============================================================================
--- user/attilio/vmcontention/share/man/man4/Makefile	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/share/man/man4/Makefile	Thu Nov  3 21:57:02 2011	(r227066)
@@ -347,6 +347,7 @@ MAN=	aac.4 \
 	pts.4 \
 	pty.4 \
 	puc.4 \
+	${_qlxgb.4} \
 	ral.4 \
 	random.4 \
 	rc.4 \
@@ -713,6 +714,10 @@ _xen.4=		xen.4
 MLINKS+=lindev.4 full.4
 .endif
 
+.if ${MACHINE_CPUARCH} == "amd64"
+_qlxgb.4=	qlxgb.4
+.endif
+
 .if ${MACHINE_CPUARCH} == "powerpc"
 _atp.4=		atp.4
 .endif

Copied: user/attilio/vmcontention/share/man/man4/qlxgb.4 (from r227065, head/share/man/man4/qlxgb.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmcontention/share/man/man4/qlxgb.4	Thu Nov  3 21:57:02 2011	(r227066, copy of r227065, head/share/man/man4/qlxgb.4)
@@ -0,0 +1,93 @@
+.\"-
+.\" Copyright (c) 2011 "Bjoern A. Zeeb" 
+.\" 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$
+.\"
+.Dd November 3, 2011
+.Dt QLXGB 4
+.Os
+.Sh NAME
+.Nm qlxgb
+.Nd "QLogic 10 Gigabit Ethernet & CNA Adapter Driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device qlxgb"
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_qlxgb_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports IPv4 checksum offload,
+TCP and UDP checksum offload for both IPv4 and IPv6,
+Large Segment Offload for both IPv4 and IPv6,
+Jumbo frames, VLAN Tag, and
+Receive Side scaling.
+For further hardware information, see
+.Pa http://www.qlogic.com/ .
+.Sh HARDWARE
+The
+.Nm
+driver supports 10 Gigabit Ethernet & CNA Adapter based on the following
+chipsets:
+.Pp
+.Bl -bullet -compact
+.It
+QLogic 3200 series
+.It
+QLogic 8200 series
+.El
+.Sh SUPPORT
+For support questions please contact your QLogic approved reseller or
+QLogic Technical Support at
+.Pa http://support.qlogic.com ,
+or by E-mail at
+.Aq support@qlogic.com .
+.Sh SEE ALSO
+.Xr altq 4 ,
+.Xr arp 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An David C Somayajulu
+at Qlogic Corporation.

Modified: user/attilio/vmcontention/share/misc/bsd-family-tree
==============================================================================
--- user/attilio/vmcontention/share/misc/bsd-family-tree	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/share/misc/bsd-family-tree	Thu Nov  3 21:57:02 2011	(r227066)
@@ -248,6 +248,9 @@ FreeBSD 5.2           |      |          
  |    8.2      7.4    |      |                 |               DragonFly 2.10.1
  |     v              |      |             OpenBSD 4.9                 |
  |                    |      |                 |                       |
+ |                    |      |                 |                       |
+ |                    |      |             OpenBSD 5.0                 |
+ |                    |      |                 |                       |
 FreeBSD 9 -current    |  NetBSD -current  OpenBSD -current             |
  |                    |      |                 |                       |
  v                    v      v                 v                       v
@@ -534,6 +537,7 @@ FreeBSD 7.4		2011-02-24 [FBD]
 FreeBSD 8.2		2011-02-24 [FBD]
 DragonFly 2.10.1	2011-04-26 [DFB]
 OpenBSD 4.9		2011-05-01 [OBD]
+OpenBSD 5.0		2011-11-01 [OBD]
 
 Bibliography
 ------------------------

Modified: user/attilio/vmcontention/sys/amd64/conf/GENERIC
==============================================================================
--- user/attilio/vmcontention/sys/amd64/conf/GENERIC	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/amd64/conf/GENERIC	Thu Nov  3 21:57:02 2011	(r227066)
@@ -107,7 +107,7 @@ options 	AHC_REG_PRETTY_PRINT	# Print re
 device		ahd		# AHA39320/29320 and onboard AIC79xx devices
 options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
 					# output.  Adds ~215k to driver.
-device		amd		# AMD 53C974 (Tekram DC-390(T))
+device		esp		# AMD Am53C974 (Tekram DC-390(T))
 device		hptiop		# Highpoint RocketRaid 3xxx series
 device		isp		# Qlogic family
 #device		ispfw		# Firmware for QLogic HBAs- normally a module

Modified: user/attilio/vmcontention/sys/arm/conf/GUMSTIX
==============================================================================
--- user/attilio/vmcontention/sys/arm/conf/GUMSTIX	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/arm/conf/GUMSTIX	Thu Nov  3 21:57:02 2011	(r227066)
@@ -70,6 +70,7 @@ options 	PREEMPTION
 device		loop
 device		ether
 device		mii
+device		mii_bitbang
 device		smc
 device		smcphy
 device		uart

Modified: user/attilio/vmcontention/sys/boot/common/loader.8
==============================================================================
--- user/attilio/vmcontention/sys/boot/common/loader.8	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/boot/common/loader.8	Thu Nov  3 21:57:02 2011	(r227066)
@@ -443,7 +443,7 @@ Sets the list of binaries which the kern
 process.
 The first matching binary is used.
 The default list is
-.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init:/stand/sysinstall .
+.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init .
 .It Va init_script
 If set to a valid file name in the root file system,
 instructs

Modified: user/attilio/vmcontention/sys/conf/NOTES
==============================================================================
--- user/attilio/vmcontention/sys/conf/NOTES	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/conf/NOTES	Thu Nov  3 21:57:02 2011	(r227066)
@@ -1459,7 +1459,9 @@ options 	TEKEN_UTF8		# UTF-8 output hand
 #      such as the Tekram DC-390(T).
 # bt:  Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x,
 #      BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F
-# esp: NCR53c9x.  Only for SBUS hardware right now.
+# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers
+#      including the AMD Am53C974 (found on devices such as the Tekram
+#      DC-390(T)) and the Sun ESP and FAS families of controllers
 # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters,
 #      ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2,
 #      ISP 12160 Ultra3 SCSI,
@@ -1846,13 +1848,15 @@ device		puc
 # MII bus support is required for many PCI Ethernet NICs,
 # namely those which use MII-compliant transceivers or implement
 # transceiver control interfaces that operate like an MII.  Adding
-# "device miibus" to the kernel config pulls in support for
-# the generic miibus API and all of the PHY drivers, including a
-# generic one for PHYs that aren't specifically handled by an
-# individual driver.  Support for specific PHYs may be built by adding
-# "device mii" then adding the appropriate PHY driver.
-device  	miibus		# MII support including all PHYs
+# "device miibus" to the kernel config pulls in support for the generic
+# miibus API, the common support for for bit-bang'ing the MII and all
+# of the PHY drivers, including a generic one for PHYs that aren't
+# specifically handled by an individual driver.  Support for specific
+# PHYs may be built by adding "device mii", "device mii_bitbang" if
+# needed by the NIC driver and then adding the appropriate PHY driver.
 device  	mii		# Minimal MII support
+device  	mii_bitbang	# Common module for bit-bang'ing the MII
+device  	miibus		# MII support w/ bit-bang'ing and all PHYs
 
 device  	acphy		# Altima Communications AC101
 device  	amphy		# AMD AM79c873 / Davicom DM910{1,2}
@@ -2809,7 +2813,7 @@ options 	UBSEC_RNDTEST	# enable rndtest 
 # Embedded system options:
 #
 # An embedded system might want to run something other than init.
-options 	INIT_PATH=/sbin/init:/stand/sysinstall
+options 	INIT_PATH=/sbin/init:/rescue/init
 
 # Debug options
 options 	BUS_DEBUG	# enable newbus debugging

Modified: user/attilio/vmcontention/sys/conf/files
==============================================================================
--- user/attilio/vmcontention/sys/conf/files	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/conf/files	Thu Nov  3 21:57:02 2011	(r227066)
@@ -1064,6 +1064,7 @@ dev/ep/if_ep_eisa.c		optional ep eisa
 dev/ep/if_ep_isa.c		optional ep isa
 dev/ep/if_ep_mca.c		optional ep mca
 dev/ep/if_ep_pccard.c		optional ep pccard
+dev/esp/esp_pci.c		optional esp pci
 dev/esp/ncr53c9x.c		optional esp
 dev/ex/if_ex.c			optional ex
 dev/ex/if_ex_isa.c		optional ex isa
@@ -1425,6 +1426,7 @@ dev/mii/ip1000phy.c		optional miibus | i
 dev/mii/jmphy.c			optional miibus | jmphy
 dev/mii/lxtphy.c		optional miibus | lxtphy
 dev/mii/mii.c			optional miibus | mii
+dev/mii/mii_bitbang.c		optional miibus | mii_bitbang
 dev/mii/mii_physubr.c		optional miibus | mii
 dev/mii/miibus_if.m		optional miibus | mii
 dev/mii/mlphy.c			optional miibus | mlphy

Modified: user/attilio/vmcontention/sys/conf/files.amd64
==============================================================================
--- user/attilio/vmcontention/sys/conf/files.amd64	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/conf/files.amd64	Thu Nov  3 21:57:02 2011	(r227066)
@@ -208,6 +208,12 @@ dev/lindev/lindev.c		optional	lindev
 dev/nfe/if_nfe.c		optional	nfe pci
 dev/nve/if_nve.c		optional	nve pci
 dev/nvram/nvram.c		optional	nvram isa
+dev/qlxgb/qla_dbg.c		optional	qlxgb pci
+dev/qlxgb/qla_hw.c		optional	qlxgb pci
+dev/qlxgb/qla_ioctl.c		optional	qlxgb pci
+dev/qlxgb/qla_isr.c		optional	qlxgb pci
+dev/qlxgb/qla_misc.c		optional	qlxgb pci
+dev/qlxgb/qla_os.c		optional	qlxgb pci
 dev/sio/sio.c			optional	sio
 dev/sio/sio_isa.c		optional	sio isa
 dev/sio/sio_pccard.c		optional	sio pccard

Modified: user/attilio/vmcontention/sys/dev/ata/ata-pci.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ata/ata-pci.c	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/ata/ata-pci.c	Thu Nov  3 21:57:02 2011	(r227066)
@@ -153,10 +153,20 @@ ata_pci_detach(device_t dev)
     }
     if (ctlr->chipdeinit != NULL)
 	ctlr->chipdeinit(dev);
-    if (ctlr->r_res2)
+    if (ctlr->r_res2) {
+#ifdef __sparc64__
+	bus_space_unmap(rman_get_bustag(ctlr->r_res2),
+	    rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2));
+#endif
 	bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
-    if (ctlr->r_res1)
+    }
+    if (ctlr->r_res1) {
+#ifdef __sparc64__
+	bus_space_unmap(rman_get_bustag(ctlr->r_res1),
+	    rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1));
+#endif
 	bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
+    }
 
     return 0;
 }
@@ -775,7 +785,6 @@ driver_t ata_pcichannel_driver = {
 
 DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);
 
-
 /*
  * misc support fucntions
  */
@@ -936,4 +945,3 @@ ata_mode2idx(int mode)
 	return (mode & ATA_MODE_MASK) + 5;
     return (mode & ATA_MODE_MASK) - ATA_PIO0;
 }
-

Modified: user/attilio/vmcontention/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ata/chipsets/ata-promise.c	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/ata/chipsets/ata-promise.c	Thu Nov  3 21:57:02 2011	(r227066)
@@ -94,7 +94,6 @@ static void ata_promise_next_hpkt(struct
 #define PR_SATA		0x40
 #define PR_SATA2	0x80
 
-
 /*
  * Promise chipset support functions
  */
@@ -250,6 +249,14 @@ ata_promise_chipinit(device_t dev)
 						    &ctlr->r_rid1, RF_ACTIVE)))
 	    goto failnfree;
 
+#ifdef __sparc64__
+	if (ctlr->chip->cfg2 == PR_SX4X &&
+	    !bus_space_map(rman_get_bustag(ctlr->r_res1),
+	    rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1),
+	    BUS_SPACE_MAP_LINEAR, NULL))
+		goto failnfree;
+#endif
+
 	ctlr->r_type2 = SYS_RES_MEMORY;
 	ctlr->r_rid2 = PCIR_BAR(3);
 	if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,

Modified: user/attilio/vmcontention/sys/dev/ata/chipsets/ata-siliconimage.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ata/chipsets/ata-siliconimage.c	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/ata/chipsets/ata-siliconimage.c	Thu Nov  3 21:57:02 2011	(r227066)
@@ -80,7 +80,6 @@ static void ata_siiprb_dmainit(device_t 
 #define SII_BUG		0x04
 #define SII_4CH		0x08
 
-
 /*
  * Silicon Image Inc. (SiI) (former CMD) chipset support functions
  */
@@ -141,6 +140,17 @@ ata_sii_chipinit(device_t dev)
 	    bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1);
 	    return ENXIO;
 	}
+#ifdef __sparc64__
+	if (!bus_space_map(rman_get_bustag(ctlr->r_res2),
+	    rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2),
+	    BUS_SPACE_MAP_LINEAR, NULL)) {
+	    	bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,
+		    ctlr->r_res1);
+		bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2,
+		    ctlr->r_res2);
+		return (ENXIO);
+	}
+#endif
 	ctlr->ch_attach = ata_siiprb_ch_attach;
 	ctlr->ch_detach = ata_siiprb_ch_detach;
 	ctlr->reset = ata_siiprb_reset;
@@ -432,7 +442,6 @@ ata_sii_setmode(device_t dev, int target
 	return (mode);
 }
 
-
 struct ata_siiprb_dma_prdentry {
     u_int64_t addr;
     u_int32_t count;

Modified: user/attilio/vmcontention/sys/dev/bm/if_bm.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/bm/if_bm.c	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/bm/if_bm.c	Thu Nov  3 21:57:02 2011	(r227066)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -105,17 +106,28 @@ static void bm_tick		(void *xsc);
 static int bm_ifmedia_upd	(struct ifnet *);
 static void bm_ifmedia_sts	(struct ifnet *, struct ifmediareq *);
 
-static void bm_miicsr_dwrite	(struct bm_softc *, u_int16_t);
-static void bm_mii_writebit	(struct bm_softc *, int);
-static int bm_mii_readbit	(struct bm_softc *);
-static void bm_mii_sync		(struct bm_softc *);
-static void bm_mii_send		(struct bm_softc *, u_int32_t, int);
-static int bm_mii_readreg	(struct bm_softc *, struct bm_mii_frame *);
-static int bm_mii_writereg	(struct bm_softc *, struct bm_mii_frame *);
 static int bm_miibus_readreg	(device_t, int, int);
 static int bm_miibus_writereg	(device_t, int, int, int);
 static void bm_miibus_statchg	(device_t);
 
+/*
+ * MII bit-bang glue
+ */
+static uint32_t bm_mii_bitbang_read(device_t);
+static void bm_mii_bitbang_write(device_t, uint32_t);
+
+static const struct mii_bitbang_ops bm_mii_bitbang_ops = {
+	bm_mii_bitbang_read,
+	bm_mii_bitbang_write,
+	{
+		BM_MII_DATAOUT,	/* MII_BIT_MDO */
+		BM_MII_DATAIN,	/* MII_BIT_MDI */
+		BM_MII_CLK,	/* MII_BIT_MDC */
+		BM_MII_OENABLE,	/* MII_BIT_DIR_HOST_PHY */
+		0,		/* MII_BIT_DIR_PHY_HOST */
+	}
+};
+
 static device_method_t bm_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		bm_probe),
@@ -150,171 +162,36 @@ DRIVER_MODULE(miibus, bm, miibus_driver,
  */
 
 /*
- * Write to the MII csr, introducing a delay to allow valid
- * MII clock pulses to be formed
- */
-static void
-bm_miicsr_dwrite(struct bm_softc *sc, u_int16_t val)
-{
-	CSR_WRITE_2(sc, BM_MII_CSR, val);
-	/*
-	 * Assume this is a clock toggle and generate a 1us delay
-	 * to cover both MII's 160ns high/low minimum and 400ns
-	 * cycle miniumum
-	 */
-	DELAY(1);
-}
-
-/*
- * Write a bit to the MII bus.
- */
-static void
-bm_mii_writebit(struct bm_softc *sc, int bit)
-{
-	u_int16_t regval;
-
-	regval = BM_MII_OENABLE;
-	if (bit)
-		regval |= BM_MII_DATAOUT;
-
-	bm_miicsr_dwrite(sc, regval);
-	bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-	bm_miicsr_dwrite(sc, regval);
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int
-bm_mii_readbit(struct bm_softc *sc)
-{
-	u_int16_t regval, bitin;
-
-	/* ~BM_MII_OENABLE */
-	regval = 0;
-
-	bm_miicsr_dwrite(sc, regval);
-	bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-	bm_miicsr_dwrite(sc, regval);
-	bitin = CSR_READ_2(sc, BM_MII_CSR) & BM_MII_DATAIN;
-
-	return (bitin == BM_MII_DATAIN);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
+ * Write the MII serial port for the MII bit-bang module.
  */
 static void
-bm_mii_sync(struct bm_softc *sc)
+bm_mii_bitbang_write(device_t dev, uint32_t val)
 {
-	int i;
-	u_int16_t regval;
-
-	regval = BM_MII_OENABLE | BM_MII_DATAOUT;
-
-	bm_miicsr_dwrite(sc, regval);
-	for (i = 0; i < 32; i++) {
-		bm_miicsr_dwrite(sc, regval | BM_MII_CLK);
-		bm_miicsr_dwrite(sc, regval);
-	}
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void
-bm_mii_send(struct bm_softc *sc, u_int32_t bits, int cnt)
-{
-	int i;
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1)
-		bm_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read a PHY register through the MII.
- */
-static int
-bm_mii_readreg(struct bm_softc *sc, struct bm_mii_frame *frame)
-{
-	int i, ack, bit;
-
-	/*
-	 * Set up frame for RX.
-	 */
-	frame->mii_stdelim = BM_MII_STARTDELIM;
-	frame->mii_opcode = BM_MII_READOP;
-	frame->mii_turnaround = 0;
-	frame->mii_data = 0;
-
-	/*
-	 * Sync the PHYs
-	 */
-	bm_mii_sync(sc);
-
-	/*
-	 * Send command/address info
-	 */
-	bm_mii_send(sc, frame->mii_stdelim, 2);
-	bm_mii_send(sc, frame->mii_opcode, 2);
-	bm_mii_send(sc, frame->mii_phyaddr, 5);
-	bm_mii_send(sc, frame->mii_regaddr, 5);
-
-	/*
-	 * Check for ack.
-	 */
-	ack = bm_mii_readbit(sc);
-
-	/*
-	 * Now try reading data bits. If the ack failed, we still
-	 * need to clock through 16 cycles to keep the PHY(s) in sync.
-	 */
-	for (i = 0x8000; i; i >>= 1) {
-		bit = bm_mii_readbit(sc);
-		if (!ack && bit)
-			frame->mii_data |= i;
-	}
+	struct bm_softc *sc;
 
-	/*
-	 * Skip through idle bit-times
-	 */
-	bm_mii_writebit(sc, 0);
-	bm_mii_writebit(sc, 0);
+	sc = device_get_softc(dev);
 
-	return ((ack) ? 1 : 0);
+	CSR_WRITE_2(sc, BM_MII_CSR, val);
+	CSR_BARRIER(sc, BM_MII_CSR, 2,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 }
 
 /*
- * Write to a PHY register through the MII.
+ * Read the MII serial port for the MII bit-bang module.
  */
-static int
-bm_mii_writereg(struct bm_softc *sc, struct bm_mii_frame *frame)
+static uint32_t
+bm_mii_bitbang_read(device_t dev)
 {
-	/*
-	 * Set up frame for tx
-	 */
-	frame->mii_stdelim = BM_MII_STARTDELIM;
-	frame->mii_opcode = BM_MII_WRITEOP;
-	frame->mii_turnaround = BM_MII_TURNAROUND;
-
-	/*
-	 * Sync the phy and start the bitbang write sequence
-	 */
-	bm_mii_sync(sc);
+	struct bm_softc *sc;
+	uint32_t reg;
 
-	bm_mii_send(sc, frame->mii_stdelim, 2);
-	bm_mii_send(sc, frame->mii_opcode, 2);
-	bm_mii_send(sc, frame->mii_phyaddr, 5);
-	bm_mii_send(sc, frame->mii_regaddr, 5);
-	bm_mii_send(sc, frame->mii_turnaround, 2);
-	bm_mii_send(sc, frame->mii_data, 16);
+	sc = device_get_softc(dev);
 
-	/*
-	 * Idle bit.
-	 */
-	bm_mii_writebit(sc, 0);
+	reg = CSR_READ_2(sc, BM_MII_CSR);
+	CSR_BARRIER(sc, BM_MII_CSR, 2,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 
-	return (0);
+	return (reg);
 }
 
 /*
@@ -323,34 +200,15 @@ bm_mii_writereg(struct bm_softc *sc, str
 static int
 bm_miibus_readreg(device_t dev, int phy, int reg)
 {
-	struct bm_softc *sc;
-	struct bm_mii_frame frame;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
 
-	bm_mii_readreg(sc, &frame);
-
-	return (frame.mii_data);
+	return (mii_bitbang_readreg(dev, &bm_mii_bitbang_ops, phy, reg));
 }
 
 static int
 bm_miibus_writereg(device_t dev, int phy, int reg, int data)
 {
-	struct bm_softc *sc;
-	struct bm_mii_frame frame;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
-	frame.mii_data = data;
 
-	bm_mii_writereg(sc, &frame);
+	mii_bitbang_readreg(dev, &bm_mii_bitbang_ops, phy, reg);
 
 	return (0);
 }

Modified: user/attilio/vmcontention/sys/dev/bm/if_bmreg.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/bm/if_bmreg.h	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/bm/if_bmreg.h	Thu Nov  3 21:57:02 2011	(r227066)
@@ -129,14 +129,6 @@
 #define BM_MII_DATAIN	0x0008		/* MDIO data in */
 
 /*
- * MII constants
- */
-#define BM_MII_STARTDELIM	0x01
-#define BM_MII_READOP		0x02
-#define BM_MII_WRITEOP		0x01
-#define BM_MII_TURNAROUND	0x02
-
-/*
  * Various flags
  */
 
@@ -174,3 +166,5 @@
 #define	CSR_READ_1(sc, reg)		\
 	bus_read_1(sc->sc_memr, reg)
 
+#define CSR_BARRIER(sc, reg, length, flags)				\
+	bus_barrier(sc->sc_memr, reg, length, flags)

Modified: user/attilio/vmcontention/sys/dev/bm/if_bmvar.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/bm/if_bmvar.h	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/bm/if_bmvar.h	Thu Nov  3 21:57:02 2011	(r227066)
@@ -46,7 +46,6 @@
 /*
  * software state for transmit job mbufs (may be elements of mbuf chains)
  */
-
 struct bm_txsoft {
 	struct mbuf *txs_mbuf;		/* head of our mbuf chain */
 	bus_dmamap_t txs_dmamap;	/* our DMA map */
@@ -71,7 +70,6 @@ struct bm_rxsoft {
 	bus_dma_segment_t segment;
 };
 
-
 struct bm_softc {
 	struct ifnet    	*sc_ifp;
 	struct mtx		sc_mtx;	
@@ -113,13 +111,3 @@ struct bm_softc {
 
 	dbdma_channel_t		*sc_txdma, *sc_rxdma;
 };
-
-struct bm_mii_frame {
-	u_int8_t		mii_stdelim;
-	u_int8_t		mii_opcode;
-	u_int8_t		mii_phyaddr;
-	u_int8_t		mii_regaddr;
-	u_int8_t		mii_turnaround;
-	u_int16_t		mii_data;
-};
-

Modified: user/attilio/vmcontention/sys/dev/dc/if_dc.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/dc/if_dc.c	Thu Nov  3 21:29:33 2011	(r227065)
+++ user/attilio/vmcontention/sys/dev/dc/if_dc.c	Thu Nov  3 21:57:02 2011	(r227066)
@@ -122,6 +122,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -149,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1);
 /*
  * Various supported device vendors/types and their names.
  */
-static const struct dc_type dc_devs[] = {
+static const struct dc_type const dc_devs[] = {
 	{ DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0,
 		"Intel 21143 10/100BaseTX" },
 	{ DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0,
@@ -272,12 +273,6 @@ static void dc_eeprom_getword_xircom(str
 static void dc_eeprom_width(struct dc_softc *);
 static void dc_read_eeprom(struct dc_softc *, caddr_t, int, int, int);
 
-static void dc_mii_writebit(struct dc_softc *, int);
-static int dc_mii_readbit(struct dc_softc *);
-static void dc_mii_sync(struct dc_softc *);
-static void dc_mii_send(struct dc_softc *, uint32_t, int);
-static int dc_mii_readreg(struct dc_softc *, struct dc_mii_frame *);
-static int dc_mii_writereg(struct dc_softc *, struct dc_mii_frame *);
 static int dc_miibus_readreg(device_t, int, int);
 static int dc_miibus_writereg(device_t, int, int, int);
 static void dc_miibus_statchg(device_t);
@@ -307,6 +302,24 @@ static int dc_decode_leaf_sym(struct dc_
 static void dc_apply_fixup(struct dc_softc *, int);
 static int dc_check_multiport(struct dc_softc *);
 
+/*
+ * MII bit-bang glue
+ */
+static uint32_t dc_mii_bitbang_read(device_t);
+static void dc_mii_bitbang_write(device_t, uint32_t);
+
+static const struct mii_bitbang_ops dc_mii_bitbang_ops = {
+	dc_mii_bitbang_read,
+	dc_mii_bitbang_write,
+	{
+		DC_SIO_MII_DATAOUT,	/* MII_BIT_MDO */
+		DC_SIO_MII_DATAIN,	/* MII_BIT_MDI */
+		DC_SIO_MII_CLK,		/* MII_BIT_MDC */
+		0,			/* MII_BIT_DIR_HOST_PHY */
+		DC_SIO_MII_DIR,		/* MII_BIT_DIR_PHY_HOST */
+	}
+};
+
 #ifdef DC_USEIOSPACE
 #define	DC_RES			SYS_RES_IOPORT
 #define	DC_RID			DC_PCI_CFBIO
@@ -611,185 +624,45 @@ dc_read_eeprom(struct dc_softc *sc, cadd
 }
 
 /*
- * The following two routines are taken from the Macronix 98713
- * Application Notes pp.19-21.
- */
-/*
- * Write a bit to the MII bus.
+ * Write the MII serial port for the MII bit-bang module.
  */
 static void
-dc_mii_writebit(struct dc_softc *sc, int bit)
+dc_mii_bitbang_write(device_t dev, uint32_t val)
 {
-	uint32_t reg;
+	struct dc_softc *sc;
 
-	reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0);
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
+	sc = device_get_softc(dev);
 
-	CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	CSR_WRITE_4(sc, DC_SIO, reg);
+	CSR_WRITE_4(sc, DC_SIO, val);
 	CSR_BARRIER_4(sc, DC_SIO,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
 }
 
 /*
- * Read a bit from the MII bus.
+ * Read the MII serial port for the MII bit-bang module.
  */
-static int
-dc_mii_readbit(struct dc_softc *sc)
+static uint32_t
+dc_mii_bitbang_read(device_t dev)
 {
-	uint32_t reg;
-
-	reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR;
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	(void)CSR_READ_4(sc, DC_SIO);
-	CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	CSR_WRITE_4(sc, DC_SIO, reg);
-	CSR_BARRIER_4(sc, DC_SIO,
-	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-	if (CSR_READ_4(sc, DC_SIO) & DC_SIO_MII_DATAIN)
-		return (1);
-
-	return (0);
-}
+	struct dc_softc *sc;
+	uint32_t val;
 
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void
-dc_mii_sync(struct dc_softc *sc)
-{
-	int i;
+	sc = device_get_softc(dev);
 
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE);
+	val = CSR_READ_4(sc, DC_SIO);
 	CSR_BARRIER_4(sc, DC_SIO,
 	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
-	DELAY(1);
-
-	for (i = 0; i < 32; i++)
-		dc_mii_writebit(sc, 1);
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void
-dc_mii_send(struct dc_softc *sc, uint32_t bits, int cnt)
-{
-	int i;
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1)
-		dc_mii_writebit(sc, bits & i);
-}
 
-/*
- * Read an PHY register through the MII.
- */
-static int
-dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame)
-{
-	int i;
-
-	/*
-	 * Set up frame for RX.
-	 */
-	frame->mii_stdelim = DC_MII_STARTDELIM;
-	frame->mii_opcode = DC_MII_READOP;
-
-	/*
-	 * Sync the PHYs.
-	 */
-	dc_mii_sync(sc);
-
-	/*
-	 * Send command/address info.
-	 */

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

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 06:57:00 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB267106566B;
	Fri,  4 Nov 2011 06:57:00 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9875A8FC0A;
	Fri,  4 Nov 2011 06:57:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA46v01d005832;
	Fri, 4 Nov 2011 06:57:00 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA46v0iZ005802;
	Fri, 4 Nov 2011 06:57:00 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201111040657.pA46v0iZ005802@svn.freebsd.org>
From: Attilio Rao 
Date: Fri, 4 Nov 2011 06:57:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227074 - in user/attilio/vmcontention: contrib/top
	lib/libc/sys share/mk sys/compat/freebsd32 sys/fs/devfs
	sys/kern sys/sys sys/vm
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 06:57:00 -0000

Author: attilio
Date: Fri Nov  4 06:56:59 2011
New Revision: 227074
URL: http://svn.freebsd.org/changeset/base/227074

Log:
  MFC

Added:
  user/attilio/vmcontention/lib/libc/sys/posix_fadvise.2
     - copied unchanged from r227073, head/lib/libc/sys/posix_fadvise.2
Modified:
  user/attilio/vmcontention/lib/libc/sys/Makefile.inc
  user/attilio/vmcontention/lib/libc/sys/Symbol.map
  user/attilio/vmcontention/lib/libc/sys/madvise.2
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_misc.c
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c
  user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c
  user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master
  user/attilio/vmcontention/sys/fs/devfs/devfs_vnops.c
  user/attilio/vmcontention/sys/kern/init_sysent.c
  user/attilio/vmcontention/sys/kern/kern_descrip.c
  user/attilio/vmcontention/sys/kern/syscalls.c
  user/attilio/vmcontention/sys/kern/syscalls.master
  user/attilio/vmcontention/sys/kern/systrace_args.c
  user/attilio/vmcontention/sys/kern/vfs_default.c
  user/attilio/vmcontention/sys/kern/vfs_subr.c
  user/attilio/vmcontention/sys/kern/vfs_syscalls.c
  user/attilio/vmcontention/sys/kern/vfs_vnops.c
  user/attilio/vmcontention/sys/kern/vnode_if.src
  user/attilio/vmcontention/sys/sys/fcntl.h
  user/attilio/vmcontention/sys/sys/file.h
  user/attilio/vmcontention/sys/sys/param.h
  user/attilio/vmcontention/sys/sys/syscall.h
  user/attilio/vmcontention/sys/sys/syscall.mk
  user/attilio/vmcontention/sys/sys/sysproto.h
  user/attilio/vmcontention/sys/sys/vnode.h
  user/attilio/vmcontention/sys/vm/vm_contig.c
  user/attilio/vmcontention/sys/vm/vm_object.c
  user/attilio/vmcontention/sys/vm/vm_object.h
Directory Properties:
  user/attilio/vmcontention/   (props changed)
  user/attilio/vmcontention/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/contrib/bind9/   (props changed)
  user/attilio/vmcontention/contrib/binutils/   (props changed)
  user/attilio/vmcontention/contrib/bzip2/   (props changed)
  user/attilio/vmcontention/contrib/com_err/   (props changed)
  user/attilio/vmcontention/contrib/compiler-rt/   (props changed)
  user/attilio/vmcontention/contrib/dialog/   (props changed)
  user/attilio/vmcontention/contrib/ee/   (props changed)
  user/attilio/vmcontention/contrib/expat/   (props changed)
  user/attilio/vmcontention/contrib/file/   (props changed)
  user/attilio/vmcontention/contrib/gcc/   (props changed)
  user/attilio/vmcontention/contrib/gdb/   (props changed)
  user/attilio/vmcontention/contrib/gdtoa/   (props changed)
  user/attilio/vmcontention/contrib/gnu-sort/   (props changed)
  user/attilio/vmcontention/contrib/groff/   (props changed)
  user/attilio/vmcontention/contrib/less/   (props changed)
  user/attilio/vmcontention/contrib/libpcap/   (props changed)
  user/attilio/vmcontention/contrib/libstdc++/   (props changed)
  user/attilio/vmcontention/contrib/llvm/   (props changed)
  user/attilio/vmcontention/contrib/llvm/tools/clang/   (props changed)
  user/attilio/vmcontention/contrib/ncurses/   (props changed)
  user/attilio/vmcontention/contrib/netcat/   (props changed)
  user/attilio/vmcontention/contrib/ntp/   (props changed)
  user/attilio/vmcontention/contrib/one-true-awk/   (props changed)
  user/attilio/vmcontention/contrib/openbsm/   (props changed)
  user/attilio/vmcontention/contrib/openpam/   (props changed)
  user/attilio/vmcontention/contrib/openresolv/   (props changed)
  user/attilio/vmcontention/contrib/pf/   (props changed)
  user/attilio/vmcontention/contrib/sendmail/   (props changed)
  user/attilio/vmcontention/contrib/tcpdump/   (props changed)
  user/attilio/vmcontention/contrib/tcsh/   (props changed)
  user/attilio/vmcontention/contrib/tnftp/   (props changed)
  user/attilio/vmcontention/contrib/top/   (props changed)
  user/attilio/vmcontention/contrib/top/install-sh   (props changed)
  user/attilio/vmcontention/contrib/tzcode/stdtime/   (props changed)
  user/attilio/vmcontention/contrib/tzcode/zic/   (props changed)
  user/attilio/vmcontention/contrib/tzdata/   (props changed)
  user/attilio/vmcontention/contrib/wpa/   (props changed)
  user/attilio/vmcontention/contrib/xz/   (props changed)
  user/attilio/vmcontention/crypto/heimdal/   (props changed)
  user/attilio/vmcontention/crypto/openssh/   (props changed)
  user/attilio/vmcontention/crypto/openssl/   (props changed)
  user/attilio/vmcontention/gnu/lib/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/binutils/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/gdb/   (props changed)
  user/attilio/vmcontention/lib/libc/   (props changed)
  user/attilio/vmcontention/lib/libc/stdtime/   (props changed)
  user/attilio/vmcontention/lib/libutil/   (props changed)
  user/attilio/vmcontention/lib/libz/   (props changed)
  user/attilio/vmcontention/sbin/   (props changed)
  user/attilio/vmcontention/sbin/ipfw/   (props changed)
  user/attilio/vmcontention/share/mk/bsd.arch.inc.mk   (props changed)
  user/attilio/vmcontention/share/zoneinfo/   (props changed)
  user/attilio/vmcontention/sys/   (props changed)
  user/attilio/vmcontention/sys/amd64/include/xen/   (props changed)
  user/attilio/vmcontention/sys/boot/   (props changed)
  user/attilio/vmcontention/sys/boot/i386/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/ski/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/ofw/   (props changed)
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/sys/conf/   (props changed)
  user/attilio/vmcontention/sys/contrib/dev/acpica/   (props changed)
  user/attilio/vmcontention/sys/contrib/octeon-sdk/   (props changed)
  user/attilio/vmcontention/sys/contrib/pf/   (props changed)
  user/attilio/vmcontention/sys/contrib/x86emu/   (props changed)
  user/attilio/vmcontention/usr.bin/calendar/   (props changed)
  user/attilio/vmcontention/usr.bin/csup/   (props changed)
  user/attilio/vmcontention/usr.bin/procstat/   (props changed)
  user/attilio/vmcontention/usr.sbin/ndiscvt/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvctl/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvd/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtsold/   (props changed)
  user/attilio/vmcontention/usr.sbin/zic/   (props changed)

Modified: user/attilio/vmcontention/lib/libc/sys/Makefile.inc
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/Makefile.inc	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/lib/libc/sys/Makefile.inc	Fri Nov  4 06:56:59 2011	(r227074)
@@ -96,7 +96,8 @@ MAN+=	abort2.2 accept.2 access.2 acct.2 
 	mq_setattr.2 \
 	msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \
 	msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \
-	pathconf.2 pdfork.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \
+	pathconf.2 pdfork.2 pipe.2 poll.2 posix_fadvise.2 posix_fallocate.2 \
+	posix_openpt.2 profil.2 \
 	pselect.2 ptrace.2 quotactl.2 \
 	read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
 	rtprio.2

Modified: user/attilio/vmcontention/lib/libc/sys/Symbol.map
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/Symbol.map	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/lib/libc/sys/Symbol.map	Fri Nov  4 06:56:59 2011	(r227074)
@@ -378,6 +378,10 @@ FBSD_1.2 {
 	setloginclass;
 };
 
+FBSD_1.3 {
+	posix_fadvise;
+};
+
 FBSDprivate_1.0 {
 	___acl_aclcheck_fd;
 	__sys___acl_aclcheck_fd;

Modified: user/attilio/vmcontention/lib/libc/sys/madvise.2
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/madvise.2	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/lib/libc/sys/madvise.2	Fri Nov  4 06:56:59 2011	(r227074)
@@ -169,7 +169,8 @@ was specified and the process does not h
 .Xr mincore 2 ,
 .Xr mprotect 2 ,
 .Xr msync 2 ,
-.Xr munmap 2
+.Xr munmap 2 ,
+.Xr posix_fadvise 2
 .Sh STANDARDS
 The
 .Fn posix_madvise

Copied: user/attilio/vmcontention/lib/libc/sys/posix_fadvise.2 (from r227073, head/lib/libc/sys/posix_fadvise.2)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmcontention/lib/libc/sys/posix_fadvise.2	Fri Nov  4 06:56:59 2011	(r227074, copy of r227073, head/lib/libc/sys/posix_fadvise.2)
@@ -0,0 +1,139 @@
+.\" Copyright (c) 1991, 1993
+.\"	The Regents of the University of California.  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.
+.\" 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+.\"
+.\"	@(#)madvise.2	8.1 (Berkeley) 6/9/93
+.\" $FreeBSD$
+.\"
+.Dd October 26, 2011
+.Dt POSIX_FADVISE 2
+.Os
+.Sh NAME
+.Nm posix_fadvise
+.Nd give advice about use of file data
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In fcntl.h
+.Ft int
+.Fn posix_fadvise "int fd" "off_t offset" "off_t len" "int advice"
+.Sh DESCRIPTION
+The
+.Fn posix_fadvise
+system call
+allows a process to describe to the system its data access behavior for an
+open file descriptor
+.Fa fd .
+The advice covers the data starting at offset
+.Fa offset
+and continuing for
+.Fa len
+bytes.
+If
+.Fa len
+is zero,
+all data from
+.Fa offset
+to the end of the file is covered.
+.Pp
+The behavior is specified by the
+.Fa advice
+parameter and may be one of:
+.Bl -tag -width POSIX_FADV_SEQUENTIAL
+.It Dv POSIX_FADV_NORMAL
+Tells the system to revert to the default data access behavior.
+.It Dv POSIX_FADV_RANDOM
+Is a hint that file data will be accessed randomly,
+and prefetching is likely not advantageous.
+.It Dv POSIX_FADV_SEQUENTIAL
+Tells the system that file data will be accessed sequentially.
+This currently does nothing as the default behavior uses heuristics to
+detect sequential behavior.
+.It Dv POSIX_FADV_WILLNEED
+Tells the system that the specified data will be accessed in the near future.
+The system may initiate an asychronous read of the data if it is not already
+present in memory.
+.It Dv POSIX_FADV_DONTNEED
+Tells the system that the specified data will not be accessed in the near
+future.
+The system may decrease the in-memory priority of clean data within the
+specified range and future access to this data may require a read operation.
+.It Dv POSIX_FADV_NOREUSE
+Tells the system that the specified data will only be accessed once and
+then not reused.
+Accesses to data within the specified range are treated as if the file
+descriptor has the
+.Dv O_DIRECT
+flag enabled.
+.El
+.Pp
+.Sh RETURN VALUES
+.Rv -std posix_fadvise
+.Sh ERRORS
+The
+.Fn posix_fadvise
+system call will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+The
+.Fa fd
+argument is not a valid file descriptor.
+.It Bq Er EINVAL
+The
+.Fa advice
+argument is not valid.
+.It Bq Er EINVAL
+The
+.Fa offset
+or
+.Fa len
+arguments are negative,
+or
+.Fa offset
++
+.Fa len
+is greater than the maximum file size.
+.It Bq Er ENODEV
+The
+.Fa fd
+argument does not refer to a regular file.
+.It Bq Er ESPIPE
+The
+.Fa fd
+argument is associated with a pipe or FIFO.
+.El
+.Sh SEE ALSO
+.Xr madvise 2
+.Sh STANDARDS
+The
+.Fn posix_fadvise
+interface conforms to
+.St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Fn posix_fadvise
+system call first appeared in
+.Fx 10.0 .

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_misc.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -2835,3 +2835,16 @@ freebsd32_posix_fallocate(struct thread 
 	ap.len = PAIR32TO64(off_t, uap->len);
 	return (sys_posix_fallocate(td, &ap));
 }
+
+int
+freebsd32_posix_fadvise(struct thread *td,
+    struct freebsd32_posix_fadvise_args *uap)
+{
+	struct posix_fadvise_args ap;
+
+	ap.fd = uap->fd;
+	ap.offset = PAIR32TO64(off_t, uap->offset);
+	ap.len = PAIR32TO64(off_t, uap->len);
+	ap.advice = uap->advice;
+	return (sys_posix_fadvise(td, &ap));
+}

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -580,6 +580,14 @@ struct freebsd32_posix_fallocate_args {
 	char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)];
 	char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)];
 };
+struct freebsd32_posix_fadvise_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)];
+	char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)];
+	char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)];
+	char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)];
+	char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
+};
 #if !defined(PAD64_REQUIRED) && defined(__powerpc__)
 #define PAD64_REQUIRED
 #endif
@@ -690,6 +698,7 @@ int	freebsd32_msgctl(struct thread *, st
 int	freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *);
 int	freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *);
 int	freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *);
+int	freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *);
 
 #ifdef COMPAT_43
 
@@ -1065,6 +1074,7 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_shmctl	AUE_SHMCTL
 #define	FREEBSD32_SYS_AUE_freebsd32_pselect	AUE_SELECT
 #define	FREEBSD32_SYS_AUE_freebsd32_posix_fallocate	AUE_NULL
+#define	FREEBSD32_SYS_AUE_freebsd32_posix_fadvise	AUE_NULL
 
 #undef PAD_
 #undef PADL_

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -424,4 +424,5 @@
 #define	FREEBSD32_SYS_rctl_add_rule	528
 #define	FREEBSD32_SYS_rctl_remove_rule	529
 #define	FREEBSD32_SYS_freebsd32_posix_fallocate	530
+#define	FREEBSD32_SYS_freebsd32_posix_fadvise	531
 #define	FREEBSD32_SYS_MAXSYSCALL	532

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -554,5 +554,5 @@ const char *freebsd32_syscallnames[] = {
 	"rctl_add_rule",			/* 528 = rctl_add_rule */
 	"rctl_remove_rule",			/* 529 = rctl_remove_rule */
 	"freebsd32_posix_fallocate",			/* 530 = freebsd32_posix_fallocate */
-	"#531",			/* 531 = posix_fadvise */
+	"freebsd32_posix_fadvise",			/* 531 = freebsd32_posix_fadvise */
 };

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 226364 2011-10-14 11:46:46Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #include "opt_compat.h"
@@ -591,5 +591,5 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 528 = rctl_add_rule */
 	{ AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 529 = rctl_remove_rule */
 	{ AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = freebsd32_posix_fallocate */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 531 = posix_fadvise */
+	{ AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = freebsd32_posix_fadvise */
 };

Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3034,6 +3034,18 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 5;
 		break;
 	}
+	/* freebsd32_posix_fadvise */
+	case 531: {
+		struct freebsd32_posix_fadvise_args *p = params;
+		iarg[0] = p->fd; /* int */
+		uarg[1] = p->offset1; /* uint32_t */
+		uarg[2] = p->offset2; /* uint32_t */
+		uarg[3] = p->len1; /* uint32_t */
+		uarg[4] = p->len2; /* uint32_t */
+		iarg[5] = p->advice; /* int */
+		*n_args = 6;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -8093,6 +8105,31 @@ systrace_setargdesc(int sysnum, int ndx,
 			break;
 		};
 		break;
+	/* freebsd32_posix_fadvise */
+	case 531:
+		switch(ndx) {
+		case 0:
+			p = "int";
+			break;
+		case 1:
+			p = "uint32_t";
+			break;
+		case 2:
+			p = "uint32_t";
+			break;
+		case 3:
+			p = "uint32_t";
+			break;
+		case 4:
+			p = "uint32_t";
+			break;
+		case 5:
+			p = "int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};

Modified: user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master
==============================================================================
--- user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master	Fri Nov  4 06:56:59 2011	(r227074)
@@ -991,4 +991,7 @@
 530	AUE_NULL	STD	{ int freebsd32_posix_fallocate(int fd,\
 				    uint32_t offset1, uint32_t offset2,\
 				    uint32_t len1, uint32_t len2); }
-531	AUE_NULL	UNIMPL	posix_fadvise
+531	AUE_NULL	STD	{ int freebsd32_posix_fadvise(int fd, \
+				    uint32_t offset1, uint32_t offset2,\
+				    uint32_t len1, uint32_t len2, \
+				    int advice); }

Modified: user/attilio/vmcontention/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- user/attilio/vmcontention/sys/fs/devfs/devfs_vnops.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/fs/devfs/devfs_vnops.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -604,6 +604,13 @@ devfs_close_f(struct file *fp, struct th
 	td->td_fpop = fp;
 	error = vnops.fo_close(fp, td);
 	td->td_fpop = fpop;
+
+	/*
+	 * The f_cdevpriv cannot be assigned non-NULL value while we
+	 * are destroying the file.
+	 */
+	if (fp->f_cdevpriv != NULL)
+		devfs_fpdrop(fp);
 	return (error);
 }
 

Modified: user/attilio/vmcontention/sys/kern/init_sysent.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/init_sysent.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/init_sysent.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #include "opt_compat.h"
@@ -565,5 +565,5 @@ struct sysent sysent[] = {
 	{ AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 528 = rctl_add_rule */
 	{ AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 529 = rctl_remove_rule */
 	{ AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = posix_fallocate */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 531 = posix_fadvise */
+	{ AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = posix_fadvise */
 };

Modified: user/attilio/vmcontention/sys/kern/kern_descrip.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/kern_descrip.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/kern_descrip.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -2575,12 +2575,6 @@ _fdrop(struct file *fp, struct thread *t
 		panic("fdrop: count %d", fp->f_count);
 	if (fp->f_ops != &badfileops)
 		error = fo_close(fp, td);
-	/*
-	 * The f_cdevpriv cannot be assigned non-NULL value while we
-	 * are destroying the file.
-	 */
-	if (fp->f_cdevpriv != NULL)
-		devfs_fpdrop(fp);
 	atomic_subtract_int(&openfiles, 1);
 	crfree(fp->f_cred);
 	uma_zfree(file_zone, fp);

Modified: user/attilio/vmcontention/sys/kern/syscalls.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/syscalls.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/syscalls.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 const char *syscallnames[] = {
@@ -538,5 +538,5 @@ const char *syscallnames[] = {
 	"rctl_add_rule",			/* 528 = rctl_add_rule */
 	"rctl_remove_rule",			/* 529 = rctl_remove_rule */
 	"posix_fallocate",			/* 530 = posix_fallocate */
-	"#531",			/* 531 = posix_fadvise */
+	"posix_fadvise",			/* 531 = posix_fadvise */
 };

Modified: user/attilio/vmcontention/sys/kern/syscalls.master
==============================================================================
--- user/attilio/vmcontention/sys/kern/syscalls.master	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/syscalls.master	Fri Nov  4 06:56:59 2011	(r227074)
@@ -947,6 +947,7 @@
 				    size_t outbuflen); }
 530	AUE_NULL	STD	{ int posix_fallocate(int fd, \
 				    off_t offset, off_t len); }
-531	AUE_NULL	UNIMPL	posix_fadvise
+531	AUE_NULL	STD	{ int posix_fadvise(int fd, off_t offset, \
+				    off_t len, int advice); }
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master

Modified: user/attilio/vmcontention/sys/kern/systrace_args.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/systrace_args.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/systrace_args.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3234,6 +3234,16 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 3;
 		break;
 	}
+	/* posix_fadvise */
+	case 531: {
+		struct posix_fadvise_args *p = params;
+		iarg[0] = p->fd; /* int */
+		iarg[1] = p->offset; /* off_t */
+		iarg[2] = p->len; /* off_t */
+		iarg[3] = p->advice; /* int */
+		*n_args = 4;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -8603,6 +8613,25 @@ systrace_setargdesc(int sysnum, int ndx,
 			break;
 		};
 		break;
+	/* posix_fadvise */
+	case 531:
+		switch(ndx) {
+		case 0:
+			p = "int";
+			break;
+		case 1:
+			p = "off_t";
+			break;
+		case 2:
+			p = "off_t";
+			break;
+		case 3:
+			p = "int";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};

Modified: user/attilio/vmcontention/sys/kern/vfs_default.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/vfs_default.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/vfs_default.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -96,6 +96,7 @@ struct vop_vector default_vnodeops = {
 
 	.vop_access =		vop_stdaccess,
 	.vop_accessx =		vop_stdaccessx,
+	.vop_advise =		vop_stdadvise,
 	.vop_advlock =		vop_stdadvlock,
 	.vop_advlockasync =	vop_stdadvlockasync,
 	.vop_advlockpurge =	vop_stdadvlockpurge,
@@ -984,6 +985,58 @@ vop_stdallocate(struct vop_allocate_args
 	return (error);
 }
 
+int
+vop_stdadvise(struct vop_advise_args *ap)
+{
+	struct vnode *vp;
+	off_t start, end;
+	int error, vfslocked;
+
+	vp = ap->a_vp;
+	switch (ap->a_advice) {
+	case POSIX_FADV_WILLNEED:
+		/*
+		 * Do nothing for now.  Filesystems should provide a
+		 * custom method which starts an asynchronous read of
+		 * the requested region.
+		 */
+		error = 0;
+		break;
+	case POSIX_FADV_DONTNEED:
+		/*
+		 * Flush any open FS buffers and then remove pages
+		 * from the backing VM object.  Using vinvalbuf() here
+		 * is a bit heavy-handed as it flushes all buffers for
+		 * the given vnode, not just the buffers covering the
+		 * requested range.
+		 */
+		error = 0;
+		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		if (vp->v_iflag & VI_DOOMED) {
+			VOP_UNLOCK(vp, 0);
+			VFS_UNLOCK_GIANT(vfslocked);
+			break;
+		}
+		vinvalbuf(vp, V_CLEANONLY, 0, 0);
+		if (vp->v_object != NULL) {
+			start = trunc_page(ap->a_start);
+			end = round_page(ap->a_end);
+			VM_OBJECT_LOCK(vp->v_object);
+			vm_object_page_cache(vp->v_object, OFF_TO_IDX(start),
+			    OFF_TO_IDX(end));
+			VM_OBJECT_UNLOCK(vp->v_object);
+		}
+		VOP_UNLOCK(vp, 0);
+		VFS_UNLOCK_GIANT(vfslocked);
+		break;
+	default:
+		error = EINVAL;
+		break;
+	}
+	return (error);
+}
+
 /*
  * vfs default ops
  * used to fill the vfs function table to get reasonable default return values.

Modified: user/attilio/vmcontention/sys/kern/vfs_subr.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/vfs_subr.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/vfs_subr.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -1191,7 +1191,7 @@ bufobj_invalbuf(struct bufobj *bo, int f
 	do {
 		error = flushbuflist(&bo->bo_clean,
 		    flags, bo, slpflag, slptimeo);
-		if (error == 0)
+		if (error == 0 && !(flags & V_CLEANONLY))
 			error = flushbuflist(&bo->bo_dirty,
 			    flags, bo, slpflag, slptimeo);
 		if (error != 0 && error != EAGAIN) {
@@ -1220,7 +1220,8 @@ bufobj_invalbuf(struct bufobj *bo, int f
 	/*
 	 * Destroy the copy in the VM cache, too.
 	 */
-	if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) {
+	if (bo->bo_object != NULL &&
+	    (flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0) {
 		VM_OBJECT_LOCK(bo->bo_object);
 		vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ?
 		    OBJPR_CLEANONLY : 0);
@@ -1229,7 +1230,7 @@ bufobj_invalbuf(struct bufobj *bo, int f
 
 #ifdef INVARIANTS
 	BO_LOCK(bo);
-	if ((flags & (V_ALT | V_NORMAL)) == 0 &&
+	if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0 &&
 	    (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0))
 		panic("vinvalbuf: flush failed");
 	BO_UNLOCK(bo);

Modified: user/attilio/vmcontention/sys/kern/vfs_syscalls.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/vfs_syscalls.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/vfs_syscalls.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information");
+
 SDT_PROVIDER_DEFINE(vfs);
 SDT_PROBE_DEFINE(vfs, , stat, mode, mode);
 SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *");
@@ -4845,3 +4847,135 @@ sys_posix_fallocate(struct thread *td, s
 
 	return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len));
 }
+
+/*
+ * Unlike madvise(2), we do not make a best effort to remember every
+ * possible caching hint.  Instead, we remember the last setting with
+ * the exception that we will allow POSIX_FADV_NORMAL to adjust the
+ * region of any current setting.
+ */
+int
+sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap)
+{
+	struct fadvise_info *fa, *new;
+	struct file *fp;
+	struct vnode *vp;
+	off_t end;
+	int error;
+
+	if (uap->offset < 0 || uap->len < 0 ||
+	    uap->offset > OFF_MAX - uap->len)
+		return (EINVAL);
+	switch (uap->advice) {
+	case POSIX_FADV_SEQUENTIAL:
+	case POSIX_FADV_RANDOM:
+	case POSIX_FADV_NOREUSE:
+		new = malloc(sizeof(*fa), M_FADVISE, M_WAITOK);
+		break;
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_WILLNEED:
+	case POSIX_FADV_DONTNEED:
+		new = NULL;
+		break;
+	default:
+		return (EINVAL);
+	}
+	/* XXX: CAP_POSIX_FADVISE? */
+	error = fget(td, uap->fd, 0, &fp);
+	if (error != 0)
+		goto out;
+	
+	switch (fp->f_type) {
+	case DTYPE_VNODE:
+		break;
+	case DTYPE_PIPE:
+	case DTYPE_FIFO:
+		error = ESPIPE;
+		goto out;
+	default:
+		error = ENODEV;
+		goto out;
+	}
+	vp = fp->f_vnode;
+	if (vp->v_type != VREG) {
+		error = ENODEV;
+		goto out;
+	}
+	if (uap->len == 0)
+		end = OFF_MAX;
+	else
+		end = uap->offset + uap->len - 1;
+	switch (uap->advice) {
+	case POSIX_FADV_SEQUENTIAL:
+	case POSIX_FADV_RANDOM:
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Try to merge any existing non-standard region with
+		 * this new region if possible, otherwise create a new
+		 * non-standard region for this request.
+		 */
+		mtx_pool_lock(mtxpool_sleep, fp);
+		fa = fp->f_advice;
+		if (fa != NULL && fa->fa_advice == uap->advice &&
+		    ((fa->fa_start <= end && fa->fa_end >= uap->offset) ||
+		    (end != OFF_MAX && fa->fa_start == end + 1) ||
+		    (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) {
+			if (uap->offset < fa->fa_start)
+				fa->fa_start = uap->offset;
+			if (end > fa->fa_end)
+				fa->fa_end = end;
+		} else {
+			new->fa_advice = uap->advice;
+			new->fa_start = uap->offset;
+			new->fa_end = end;
+			fp->f_advice = new;
+			new = fa;
+		}
+		mtx_pool_unlock(mtxpool_sleep, fp);
+		break;
+	case POSIX_FADV_NORMAL:
+		/*
+		 * If a the "normal" region overlaps with an existing
+		 * non-standard region, trim or remove the
+		 * non-standard region.
+		 */
+		mtx_pool_lock(mtxpool_sleep, fp);
+		fa = fp->f_advice;
+		if (fa != NULL) {
+			if (uap->offset <= fa->fa_start &&
+			    end >= fa->fa_end) {
+				new = fa;
+				fp->f_advice = NULL;
+			} else if (uap->offset <= fa->fa_start &&
+			    end >= fa->fa_start)
+				fa->fa_start = end + 1;
+			else if (uap->offset <= fa->fa_end &&
+			    end >= fa->fa_end)
+				fa->fa_end = uap->offset - 1;
+			else if (uap->offset >= fa->fa_start &&
+			    end <= fa->fa_end) {
+				/*
+				 * If the "normal" region is a middle
+				 * portion of the existing
+				 * non-standard region, just remove
+				 * the whole thing rather than picking
+				 * one side or the other to
+				 * preserve.
+				 */
+				new = fa;
+				fp->f_advice = NULL;
+			}
+		}
+		mtx_pool_unlock(mtxpool_sleep, fp);
+		break;
+	case POSIX_FADV_WILLNEED:
+	case POSIX_FADV_DONTNEED:
+		error = VOP_ADVISE(vp, uap->offset, end, uap->advice);
+		break;
+	}
+out:
+	if (fp != NULL)
+		fdrop(fp, td);
+	free(new, M_FADVISE);
+	return (error);
+}

Modified: user/attilio/vmcontention/sys/kern/vfs_vnops.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/vfs_vnops.c	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/vfs_vnops.c	Fri Nov  4 06:56:59 2011	(r227074)
@@ -518,7 +518,7 @@ vn_read(fp, uio, active_cred, flags, td)
 	struct vnode *vp;
 	int error, ioflag;
 	struct mtx *mtxp;
-	int vfslocked;
+	int advice, vfslocked;
 
 	KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
 	    uio->uio_td, td));
@@ -529,27 +529,48 @@ vn_read(fp, uio, active_cred, flags, td)
 		ioflag |= IO_NDELAY;
 	if (fp->f_flag & O_DIRECT)
 		ioflag |= IO_DIRECT;
+	advice = POSIX_FADV_NORMAL;
 	vfslocked = VFS_LOCK_GIANT(vp->v_mount);
 	/*
 	 * According to McKusick the vn lock was protecting f_offset here.
 	 * It is now protected by the FOFFSET_LOCKED flag.
 	 */
-	if ((flags & FOF_OFFSET) == 0) {
+	if ((flags & FOF_OFFSET) == 0 || fp->f_advice != NULL) {
 		mtxp = mtx_pool_find(mtxpool_sleep, fp);
 		mtx_lock(mtxp);
-		while(fp->f_vnread_flags & FOFFSET_LOCKED) {
-			fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
-			msleep(&fp->f_vnread_flags, mtxp, PUSER -1,
-			    "vnread offlock", 0);
+		if ((flags & FOF_OFFSET) == 0) {
+			while (fp->f_vnread_flags & FOFFSET_LOCKED) {
+				fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
+				msleep(&fp->f_vnread_flags, mtxp, PUSER -1,
+				    "vnread offlock", 0);
+			}
+			fp->f_vnread_flags |= FOFFSET_LOCKED;
+			uio->uio_offset = fp->f_offset;
 		}
-		fp->f_vnread_flags |= FOFFSET_LOCKED;
+		if (fp->f_advice != NULL &&
+		    uio->uio_offset >= fp->f_advice->fa_start &&
+		    uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
+			advice = fp->f_advice->fa_advice;
 		mtx_unlock(mtxp);
-		vn_lock(vp, LK_SHARED | LK_RETRY);
-		uio->uio_offset = fp->f_offset;
-	} else
-		vn_lock(vp, LK_SHARED | LK_RETRY);
+	}
+	vn_lock(vp, LK_SHARED | LK_RETRY);
 
-	ioflag |= sequential_heuristic(uio, fp);
+	switch (advice) {
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_SEQUENTIAL:
+		ioflag |= sequential_heuristic(uio, fp);
+		break;
+	case POSIX_FADV_RANDOM:
+		/* Disable read-ahead for random I/O. */
+		break;
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Request the underlying FS to discard the buffers
+		 * and pages after the I/O is complete.
+		 */
+		ioflag |= IO_DIRECT;
+		break;
+	}
 
 #ifdef MAC
 	error = mac_vnode_check_read(active_cred, fp->f_cred, vp);
@@ -584,7 +605,8 @@ vn_write(fp, uio, active_cred, flags, td
 	struct vnode *vp;
 	struct mount *mp;
 	int error, ioflag, lock_flags;
-	int vfslocked;
+	struct mtx *mtxp;
+	int advice, vfslocked;
 
 	KASSERT(uio->uio_td == td, ("uio_td %p is not td %p",
 	    uio->uio_td, td));
@@ -618,7 +640,33 @@ vn_write(fp, uio, active_cred, flags, td
 	vn_lock(vp, lock_flags | LK_RETRY);
 	if ((flags & FOF_OFFSET) == 0)
 		uio->uio_offset = fp->f_offset;
-	ioflag |= sequential_heuristic(uio, fp);
+	advice = POSIX_FADV_NORMAL;
+	if (fp->f_advice != NULL) {
+		mtxp = mtx_pool_find(mtxpool_sleep, fp);
+		mtx_lock(mtxp);
+		if (fp->f_advice != NULL &&
+		    uio->uio_offset >= fp->f_advice->fa_start &&
+		    uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end)
+			advice = fp->f_advice->fa_advice;
+		mtx_unlock(mtxp);
+	}
+	switch (advice) {
+	case POSIX_FADV_NORMAL:
+	case POSIX_FADV_SEQUENTIAL:
+		ioflag |= sequential_heuristic(uio, fp);
+		break;
+	case POSIX_FADV_RANDOM:
+		/* XXX: Is this correct? */
+		break;
+	case POSIX_FADV_NOREUSE:
+		/*
+		 * Request the underlying FS to discard the buffers
+		 * and pages after the I/O is complete.
+		 */
+		ioflag |= IO_DIRECT;
+		break;
+	}
+
 #ifdef MAC
 	error = mac_vnode_check_write(active_cred, fp->f_cred, vp);
 	if (error == 0)

Modified: user/attilio/vmcontention/sys/kern/vnode_if.src
==============================================================================
--- user/attilio/vmcontention/sys/kern/vnode_if.src	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/kern/vnode_if.src	Fri Nov  4 06:56:59 2011	(r227074)
@@ -628,3 +628,12 @@ vop_allocate {
 	INOUT off_t *offset;
 	INOUT off_t *len;
 };
+
+%% advise	vp	U U U
+
+vop_advise {
+	IN struct vnode *vp;
+	IN off_t start;
+	IN off_t end;
+	IN int advice;
+};

Modified: user/attilio/vmcontention/sys/sys/fcntl.h
==============================================================================
--- user/attilio/vmcontention/sys/sys/fcntl.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/fcntl.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -277,9 +277,17 @@ struct oflock {
 #define	LOCK_UN		0x08		/* unlock file */
 #endif
 
+#if __POSIX_VISIBLE >= 200112
 /*
- * XXX missing posix_fadvise() and POSIX_FADV_* macros.
+ * Advice to posix_fadvise
  */
+#define	POSIX_FADV_NORMAL	0	/* no special treatment */
+#define	POSIX_FADV_RANDOM	1	/* expect random page references */
+#define	POSIX_FADV_SEQUENTIAL	2	/* expect sequential page references */
+#define	POSIX_FADV_WILLNEED	3	/* will need these pages */
+#define	POSIX_FADV_DONTNEED	4	/* dont need these pages */
+#define	POSIX_FADV_NOREUSE	5	/* access data only once */
+#endif
 
 #ifndef _KERNEL
 __BEGIN_DECLS
@@ -293,6 +301,7 @@ int	flock(int, int);
 int	openat(int, const char *, int, ...);
 #endif
 #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
+int	posix_fadvise(int, off_t, off_t, int);
 int	posix_fallocate(int, off_t, off_t);
 #endif
 __END_DECLS

Modified: user/attilio/vmcontention/sys/sys/file.h
==============================================================================
--- user/attilio/vmcontention/sys/sys/file.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/file.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -122,6 +122,12 @@ struct fileops {
  * none	not locked
  */
 
+struct fadvise_info {
+	int		fa_advice;	/* (f) FADV_* type. */
+	off_t		fa_start;	/* (f) Region start. */
+	off_t		fa_end;		/* (f) Region end. */
+};
+
 struct file {
 	void		*f_data;	/* file descriptor specific data */
 	struct fileops	*f_ops;		/* File operations */
@@ -136,7 +142,11 @@ struct file {
 	 */
 	int		f_seqcount;	/* Count of sequential accesses. */
 	off_t		f_nextoff;	/* next expected read/write offset. */
-	struct cdev_privdata *f_cdevpriv; /* (d) Private data for the cdev. */
+	union {
+		struct cdev_privdata *fvn_cdevpriv;
+					/* (d) Private data for the cdev. */
+		struct fadvise_info *fvn_advice;
+	} f_vnun;
 	/*
 	 *  DFLAG_SEEKABLE specific fields
 	 */
@@ -147,6 +157,9 @@ struct file {
 	void		*f_label;	/* Place-holder for MAC label. */
 };
 
+#define	f_cdevpriv	f_vnun.fvn_cdevpriv
+#define	f_advice	f_vnun.fvn_advice
+
 #define	FOFFSET_LOCKED       0x1
 #define	FOFFSET_LOCK_WAITING 0x2		 
 

Modified: user/attilio/vmcontention/sys/sys/param.h
==============================================================================
--- user/attilio/vmcontention/sys/sys/param.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/param.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1000000	/* Master, propagated to newvers */
+#define __FreeBSD_version 1000001	/* Master, propagated to newvers */
 
 #ifdef _KERNEL
 #define	P_OSREL_SIGWAIT		700000

Modified: user/attilio/vmcontention/sys/sys/syscall.h
==============================================================================
--- user/attilio/vmcontention/sys/sys/syscall.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/syscall.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #define	SYS_syscall	0
@@ -446,4 +446,5 @@
 #define	SYS_rctl_add_rule	528
 #define	SYS_rctl_remove_rule	529
 #define	SYS_posix_fallocate	530
+#define	SYS_posix_fadvise	531
 #define	SYS_MAXSYSCALL	532

Modified: user/attilio/vmcontention/sys/sys/syscall.mk
==============================================================================
--- user/attilio/vmcontention/sys/sys/syscall.mk	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/syscall.mk	Fri Nov  4 06:56:59 2011	(r227074)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+# created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
 MIASM =  \
 	syscall.o \
 	exit.o \
@@ -394,4 +394,5 @@ MIASM =  \
 	rctl_get_limits.o \
 	rctl_add_rule.o \
 	rctl_remove_rule.o \
-	posix_fallocate.o
+	posix_fallocate.o \
+	posix_fadvise.o

Modified: user/attilio/vmcontention/sys/sys/sysproto.h
==============================================================================
--- user/attilio/vmcontention/sys/sys/sysproto.h	Fri Nov  4 06:14:18 2011	(r227073)
+++ user/attilio/vmcontention/sys/sys/sysproto.h	Fri Nov  4 06:56:59 2011	(r227074)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 224987 2011-08-18 22:51:30Z jonathan 
+ * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb 
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -1733,6 +1733,12 @@ struct posix_fallocate_args {
 	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
 	char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)];
 };
+struct posix_fadvise_args {
+	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+	char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
+	char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)];
+	char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
+};
 int	nosys(struct thread *, struct nosys_args *);
 void	sys_sys_exit(struct thread *, struct sys_exit_args *);
 int	sys_fork(struct thread *, struct fork_args *);
@@ -2109,6 +2115,7 @@ int	sys_rctl_get_limits(struct thread *,
 int	sys_rctl_add_rule(struct thread *, struct rctl_add_rule_args *);
 int	sys_rctl_remove_rule(struct thread *, struct rctl_remove_rule_args *);
 int	sys_posix_fallocate(struct thread *, struct posix_fallocate_args *);
+int	sys_posix_fadvise(struct thread *, struct posix_fadvise_args *);
 

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

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 13:28:18 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39DE2106566B;
	Fri,  4 Nov 2011 13:28:18 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A94B8FC0C;
	Fri,  4 Nov 2011 13:28:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4DSIXU019865;
	Fri, 4 Nov 2011 13:28:18 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4DSIQq019863;
	Fri, 4 Nov 2011 13:28:18 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111041328.pA4DSIQq019863@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 13:28:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227077 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:28:18 -0000

Author: adrian
Date: Fri Nov  4 13:28:17 2011
New Revision: 227077
URL: http://svn.freebsd.org/changeset/base/227077

Log:
  Disable compression, not needed.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Fri Nov  4 11:14:04 2011	(r227076)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c	Fri Nov  4 13:28:17 2011	(r227077)
@@ -1138,6 +1138,7 @@ ar5416ResetTxQueue(struct ath_hal *ah, u
 	OS_REG_WRITE(ah, AR_QMISC(q), qmisc);
 	OS_REG_WRITE(ah, AR_DMISC(q), dmisc);
 
+#if 0
 	/* Setup compression scratchpad buffer */
 	/* 
 	 * XXX: calling this asynchronously to queue operation can
@@ -1153,6 +1154,7 @@ ar5416ResetTxQueue(struct ath_hal *ah, u
 			     OS_REG_READ(ah, AR_Q0_MISC + 4*q)
 			     | AR_Q_MISC_QCU_COMP_EN);
 	}
+#endif
 	
 	/*
 	 * Always update the secondary interrupt mask registers - this

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 13:29:48 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F1C4106566B;
	Fri,  4 Nov 2011 13:29:48 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FF9A8FC08;
	Fri,  4 Nov 2011 13:29:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4DTmpE019942;
	Fri, 4 Nov 2011 13:29:48 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4DTmWp019939;
	Fri, 4 Nov 2011 13:29:48 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111041329.pA4DTmWp019939@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 13:29:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227078 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:29:48 -0000

Author: adrian
Date: Fri Nov  4 13:29:48 2011
New Revision: 227078
URL: http://svn.freebsd.org/changeset/base/227078

Log:
  Disable the compression registers; not needed for AR5416 and later

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:28:17 2011	(r227077)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:29:48 2011	(r227078)
@@ -388,8 +388,10 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 #endif
 	ar5416InitBB(ah, chan);
 
+#if 0
 	/* Setup compression registers */
 	ar5212SetCompRegs(ah);		/* XXX not needed? */
+#endif
 
 	/*
 	 * 5416 baseband will check the per rate power table

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 13:31:04 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45329106564A;
	Fri,  4 Nov 2011 13:31:04 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 362C38FC12;
	Fri,  4 Nov 2011 13:31:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4DV4OS020033;
	Fri, 4 Nov 2011 13:31:04 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4DV4Tb020031;
	Fri, 4 Nov 2011 13:31:04 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111041331.pA4DV4Tb020031@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 13:31:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227079 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 13:31:04 -0000

Author: adrian
Date: Fri Nov  4 13:31:03 2011
New Revision: 227079
URL: http://svn.freebsd.org/changeset/base/227079

Log:
  Call the correct chipset power routine when disabling the NIC.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:29:48 2011	(r227078)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 13:31:03 2011	(r227079)
@@ -1180,7 +1180,7 @@ ar5416GetRfgain(struct ath_hal *ah)
 HAL_BOOL
 ar5416Disable(struct ath_hal *ah)
 {
-	if (!ar5212SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE))
+	if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE))
 		return AH_FALSE;
 	if (! ar5416SetResetReg(ah, HAL_RESET_COLD))
 		return AH_FALSE;

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 22:56:49 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E7B3106566C;
	Fri,  4 Nov 2011 22:56:49 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E46D8FC1E;
	Fri,  4 Nov 2011 22:56:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4MumNI038016;
	Fri, 4 Nov 2011 22:56:48 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4MumNM038014;
	Fri, 4 Nov 2011 22:56:48 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111042256.pA4MumNM038014@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 22:56:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227096 -
	user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 22:56:49 -0000

Author: adrian
Date: Fri Nov  4 22:56:48 2011
New Revision: 227096
URL: http://svn.freebsd.org/changeset/base/227096

Log:
  Since the v14 eeprom code already returns default parameter values for
  txgain/rxgain types, we don't have to check the version here.
  Just trust the eeprom code to give us the correct value.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Fri Nov  4 22:53:52 2011	(r227095)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Fri Nov  4 22:56:48 2011	(r227096)
@@ -131,10 +131,6 @@ ar9280InitPLL(struct ath_hal *ah, const 
 	OS_DELAY(RTC_PLL_SETTLE_DELAY);
 	OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK);
 }
-	
-/* XXX shouldn't be here! */
-#define	EEP_MINOR(_ah) \
-	(AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK)
 
 /*
  * Attach for an AR9280 part.
@@ -312,54 +308,42 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 		    AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset);
 
 	if (AR_SREV_MERLIN_20(ah)) {
-		if (EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_17) {
-			/* setup rxgain table */
-			switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE,
-			    AH_NULL)) {
-			case AR5416_EEP_RXGAIN_13dB_BACKOFF:
-				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
-				    ar9280Modes_backoff_13db_rxgain_v2, 6);
-				break;
-			case AR5416_EEP_RXGAIN_23dB_BACKOFF:
-				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
-				    ar9280Modes_backoff_23db_rxgain_v2, 6);
-				break;
-			case AR5416_EEP_RXGAIN_ORIG:
-				HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
-				    ar9280Modes_original_rxgain_v2, 6);
-				break;
-			default:
-				HALASSERT(AH_FALSE);
-				goto bad;
-			}
-		} else {
-			/* Default to original RX gain */
+		/* setup rxgain table */
+		switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE,
+		    AH_NULL)) {
+		case AR5416_EEP_RXGAIN_13dB_BACKOFF:
+			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
+			    ar9280Modes_backoff_13db_rxgain_v2, 6);
+			break;
+		case AR5416_EEP_RXGAIN_23dB_BACKOFF:
+			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
+			    ar9280Modes_backoff_23db_rxgain_v2, 6);
+			break;
+		case AR5416_EEP_RXGAIN_ORIG:
 			HAL_INI_INIT(&ahp9280->ah_ini_rxgain,
 			    ar9280Modes_original_rxgain_v2, 6);
+			break;
+		default:
+			HALASSERT(AH_FALSE);
+			goto bad;
 		}
 	}
 
 	if (AR_SREV_MERLIN_20(ah)) {
-		if (EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_19) {
-			/* setp txgain table */
-			switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE,
-			    AH_NULL)) {
-			case AR5416_EEP_TXGAIN_HIGH_POWER:
-				HAL_INI_INIT(&ahp9280->ah_ini_txgain,
-				    ar9280Modes_high_power_tx_gain_v2, 6);
-				break;
-			case AR5416_EEP_TXGAIN_ORIG:
-				HAL_INI_INIT(&ahp9280->ah_ini_txgain,
-				    ar9280Modes_original_tx_gain_v2, 6);
-				break;
-			default:
-				HALASSERT(AH_FALSE);
-				goto bad;
-			}
-		} else {
-			/* Default to original TX gain */
+		/* setp txgain table */
+		switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE,
+		    AH_NULL)) {
+		case AR5416_EEP_TXGAIN_HIGH_POWER:
+			HAL_INI_INIT(&ahp9280->ah_ini_txgain,
+			    ar9280Modes_high_power_tx_gain_v2, 6);
+			break;
+		case AR5416_EEP_TXGAIN_ORIG:
 			HAL_INI_INIT(&ahp9280->ah_ini_txgain,
 			    ar9280Modes_original_tx_gain_v2, 6);
+			break;
+		default:
+			HALASSERT(AH_FALSE);
+			goto bad;
 		}
 	}
 

From owner-svn-src-user@FreeBSD.ORG  Fri Nov  4 22:58:34 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 687511065675;
	Fri,  4 Nov 2011 22:58:34 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 587908FC1D;
	Fri,  4 Nov 2011 22:58:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA4MwYEg038099;
	Fri, 4 Nov 2011 22:58:34 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA4MwYr9038097;
	Fri, 4 Nov 2011 22:58:34 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111042258.pA4MwYr9038097@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 4 Nov 2011 22:58:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227097 - user/adrian/if_ath_tx/sys/dev/ath/ath_hal
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Nov 2011 22:58:34 -0000

Author: adrian
Date: Fri Nov  4 22:58:34 2011
New Revision: 227097
URL: http://svn.freebsd.org/changeset/base/227097

Log:
  Implement an analog register write, which Merlin requires a delay for.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_internal.h

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_internal.h	Fri Nov  4 22:56:48 2011	(r227096)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_internal.h	Fri Nov  4 22:58:34 2011	(r227097)
@@ -485,6 +485,8 @@ isBigEndian(void)
 /* Analog register writes may require a delay between each one (eg Merlin?) */
 #define	OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \
 	do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0)
+#define	OS_A_REG_WRITE(_a, _r, _v) \
+	do { OS_REG_WRITE(_a, _r, _v) ; OS_DELAY(100); } while (0)
 
 /* wait for the register contents to have the specified value */
 extern	HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg,

From owner-svn-src-user@FreeBSD.ORG  Sat Nov  5 01:42:55 2011
Return-Path: 
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 658EE1065672;
	Sat,  5 Nov 2011 01:42:55 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BF398FC12;
	Sat,  5 Nov 2011 01:42:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA51gt4g043191;
	Sat, 5 Nov 2011 01:42:55 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA51gtGr043187;
	Sat, 5 Nov 2011 01:42:55 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201111050142.pA51gtGr043187@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 5 Nov 2011 01:42:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r227100 - in user/adrian/if_ath_tx/sys/dev/ath: .
	ath_hal ath_hal/ar5416
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental " user"
	src tree" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Nov 2011 01:42:55 -0000

Author: adrian
Date: Sat Nov  5 01:42:54 2011
New Revision: 227100
URL: http://svn.freebsd.org/changeset/base/227100

Log:
  Begin adding support to force a full chip reset when the reset HAL
  method is called, rather than a warm reset.
  
  Merlin (at least) seems to get very annoyed after a while when interference
  is present. It's possible that part of why the AR9220/AR9280 is getting angry
  is due to (more) incorrect software programming of things, but once things
  _get_ too angry, it stays that way through a warm reset.
  
  Some further testing and resaerch is needed to figure out what's going on.
  It's likely that the "correct" thing to do with this WAR is to extend the
  reset HAL method to take a "warm or full" flag and then set a "full"
  reset during a stuck beacon situation or when interference is detected.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h
  user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h	Sat Nov  5 01:42:54 2011	(r227100)
@@ -780,7 +780,9 @@ typedef struct
 	int ah_dma_beacon_response_time;/* in TU's */
 	int ah_sw_beacon_response_time;	/* in TU's */
 	int ah_additional_swba_backoff;	/* in TU's */
-	int ah_cca;
+	int ah_cca;			/* override minCCApwr; for debugging only! */
+	int ah_force_full_reset;	/* force full chip reset rather then warm reset */
+
 } HAL_OPS_CONFIG;
 
 /*

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Nov  5 01:42:54 2011	(r227100)
@@ -146,7 +146,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 
 	/* For chips on which the RTC reset is done, save TSF before it gets cleared */
 	if (AR_SREV_HOWL(ah) ||
-	    (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)))
+	    (AR_SREV_MERLIN(ah) &&
+	     ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) ||
+	    (ah->ah_config.ah_force_full_reset))
 		tsf = ar5416GetTsf64(ah);
 
 	/* Mark PHY as inactive; marked active in ar5416InitBB() */
@@ -735,12 +737,15 @@ ar5416ChipReset(struct ath_hal *ah, cons
 {
 	OS_MARK(ah, AH_MARK_CHIPRESET, chan ? chan->ic_freq : 0);
 	/*
-	 * Warm reset is optimistic.
+	 * Warm reset is optimistic for open-loop TX power control.
 	 */
 	if (AR_SREV_MERLIN(ah) &&
 	    ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) {
 		if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
 			return AH_FALSE;
+	} else if (ah->ah_config.ah_force_full_reset) {
+		if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
+			return AH_FALSE;
 	} else {
 		if (!ar5416SetResetReg(ah, HAL_RESET_WARM))
 			return AH_FALSE;

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c	Sat Nov  5 01:42:54 2011	(r227100)
@@ -898,4 +898,9 @@ ath_sysctl_hal_attach(struct ath_softc *
 	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "cca", CTLFLAG_RW,
 	    &sc->sc_ah->ah_config.ah_cca, 0, "CCA override");
 
+	sc->sc_ah->ah_config.ah_force_full_reset = 0;
+	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "force_full_reset", CTLFLAG_RW,
+	    &sc->sc_ah->ah_config.ah_force_full_reset, 0,
+	    "Force full chip reset rather than a warm reset");
+
 }