From owner-p4-projects@FreeBSD.ORG Thu Jul 6 11:47:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A5B4716A66C; Thu, 6 Jul 2006 11:47:41 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A3FB16A669; Thu, 6 Jul 2006 11:47:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF44B43D46; Thu, 6 Jul 2006 11:47:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k66BlZ8t008534; Thu, 6 Jul 2006 07:47:39 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Wojciech A. Koszek" Date: Thu, 6 Jul 2006 07:46:39 -0400 User-Agent: KMail/1.9.1 References: <200607061128.k66BSqLl066758@repoman.freebsd.org> In-Reply-To: <200607061128.k66BSqLl066758@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607060746.40047.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Thu, 06 Jul 2006 07:47:39 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1586/Wed Jul 5 15:22:07 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 100724 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2006 11:47:41 -0000 On Thursday 06 July 2006 07:28, Wojciech A. Koszek wrote: > http://perforce.freebsd.org/chv.cgi?CH=100724 > > Change 100724 by wkoszek@wkoszek_laptop on 2006/07/06 11:28:17 > > Use more ARM-like style of sf_buf.h. But mips has a direct-map (either k0seg or k1seg). We should be using that for sfbuf's which is much more like the alpha or amd64 style. > Affected files ... > > .. //depot/projects/mips2/src/sys/mips/include/sf_buf.h#2 edit > > Differences ... > > ==== //depot/projects/mips2/src/sys/mips/include/sf_buf.h#2 (text+ko) ==== > > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2003, 2005 Alan L. Cox > + * Copyright (c) [year] [your name] > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -23,36 +23,35 @@ > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * > - * $FreeBSD: src/sys/amd64/include/sf_buf.h,v 1.3 2005/02/28 23:38:15 peter Exp $ > + * $Id$ > */ > - > #ifndef _MACHINE_SF_BUF_H_ > #define _MACHINE_SF_BUF_H_ > > -#include > -#include > -#include > +#include > + > +struct vm_page; > > -/* > - * On this machine, the only purpose for which sf_buf is used is to implement > - * an opaque pointer required by the machine-independent parts of the kernel. > - * That pointer references the vm_page that is "mapped" by the sf_buf. The > - * actual mapping is provided by the direct virtual-to-physical mapping. > - */ > -struct sf_buf; > +struct sf_buf { > + LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ > + TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ > + struct vm_page *m; /* currently mapped page */ > + vm_offset_t kva; /* va of mapping */ > + int ref_count; /* usage of this mapping */ > +}; > > static __inline vm_offset_t > sf_buf_kva(struct sf_buf *sf) > { > > - return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); > + return (sf->kva); > } > > -static __inline vm_page_t > +static __inline struct vm_page * > sf_buf_page(struct sf_buf *sf) > { > > - return ((vm_page_t)sf); > + return (sf->m); > } > > #endif /* !_MACHINE_SF_BUF_H_ */ > -- John Baldwin