From owner-p4-projects@FreeBSD.ORG Thu Jul 6 11:28:53 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 7194116A4E1; Thu, 6 Jul 2006 11:28:53 +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 4CFC016A4DF for ; Thu, 6 Jul 2006 11:28:53 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13A1A43D49 for ; Thu, 6 Jul 2006 11:28:53 +0000 (GMT) (envelope-from wkoszek@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k66BSqsU066761 for ; Thu, 6 Jul 2006 11:28:52 GMT (envelope-from wkoszek@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k66BSqLl066758 for perforce@freebsd.org; Thu, 6 Jul 2006 11:28:52 GMT (envelope-from wkoszek@FreeBSD.org) Date: Thu, 6 Jul 2006 11:28:52 GMT Message-Id: <200607061128.k66BSqLl066758@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wkoszek@FreeBSD.org using -f From: "Wojciech A. Koszek" To: Perforce Change Reviews Cc: Subject: 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:28:53 -0000 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. 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_ */