From owner-svn-src-user@FreeBSD.ORG Sat May 15 23:15:24 2010 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 C9AF7106566B; Sat, 15 May 2010 23:15:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9D818FC1F; Sat, 15 May 2010 23:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FNFOVh019500; Sat, 15 May 2010 23:15:24 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FNFO4P019498; Sat, 15 May 2010 23:15:24 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201005152315.o4FNFO4P019498@svn.freebsd.org> From: Kip Macy Date: Sat, 15 May 2010 23:15: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: r208124 - user/kmacy/stable_7_page_lock/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: Sat, 15 May 2010 23:15:25 -0000 Author: kmacy Date: Sat May 15 23:15:24 2010 New Revision: 208124 URL: http://svn.freebsd.org/changeset/base/208124 Log: eliminate lock_object casts Modified: user/kmacy/stable_7_page_lock/sys/amd64/amd64/pmap.c Modified: user/kmacy/stable_7_page_lock/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/stable_7_page_lock/sys/amd64/amd64/pmap.c Sat May 15 23:00:40 2010 (r208123) +++ user/kmacy/stable_7_page_lock/sys/amd64/amd64/pmap.c Sat May 15 23:15:24 2010 (r208124) @@ -166,6 +166,7 @@ __FBSDID("$FreeBSD$"); #endif #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) +#define PMAP_LOCKOBJPTR(pmap) ((struct lock_object *)(&(pmap)->pm_mtx)) struct pmap kernel_pmap_store; @@ -3194,18 +3195,14 @@ pmap_enter(pmap_t pmap, vm_offset_t va, opa = 0; opalocked = FALSE; ls_init(&ls); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(lockedpa)); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PMAP_LOCKPTR(pmap)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(lockedpa)); + ls_push(&ls, &lock_class_mtx_sleep, PMAP_LOCKOBJPTR(pmap)); if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { while ((pv = get_pv_entry(pmap)) == NULL) { ls_popa(&ls); VM_WAIT; - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(lockedpa)); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PMAP_LOCKPTR(pmap)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(lockedpa)); + ls_push(&ls, &lock_class_mtx_sleep, PMAP_LOCKOBJPTR(pmap)); } } @@ -3229,10 +3226,8 @@ restart: origpte = *pte; if (opa && (opa != (origpte & PG_FRAME))) { ls_popa(&ls); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(lockedpa)); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PMAP_LOCKPTR(pmap)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(lockedpa)); + ls_push(&ls, &lock_class_mtx_sleep, PMAP_LOCKOBJPTR(pmap)); opalocked = FALSE; opa = 0; goto restart; @@ -3241,23 +3236,17 @@ restart: opa = origpte & PG_FRAME; if (opa && (opa != lockedpa) && (opalocked == FALSE)) { opalocked = TRUE; - if (ls_trypush(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(opa)) == 0) { + if (ls_trypush(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(opa)) == 0) { ls_popa(&ls); if ((uintptr_t)PA_LOCKPTR(lockedpa) < (uintptr_t)PA_LOCKPTR(opa)) { - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(lockedpa)); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(opa)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(lockedpa)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(opa)); } else { - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(opa)); - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PA_LOCKPTR(lockedpa)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(opa)); + ls_push(&ls, &lock_class_mtx_sleep, PA_LOCKOBJPTR(lockedpa)); } - ls_push(&ls, &lock_class_mtx_sleep, - (struct lock_object *)PMAP_LOCKPTR(pmap)); + ls_push(&ls, &lock_class_mtx_sleep, PMAP_LOCKOBJPTR(pmap)); goto restart; } }