sf_buf.h revision 122780
1122780Salc/*- 2122780Salc * Copyright (c) 2003 Alan L. Cox <alc@cs.rice.edu> 3122780Salc * All rights reserved. 4122780Salc * 5122780Salc * Redistribution and use in source and binary forms, with or without 6122780Salc * modification, are permitted provided that the following conditions 7122780Salc * are met: 8122780Salc * 1. Redistributions of source code must retain the above copyright 9122780Salc * notice, this list of conditions and the following disclaimer. 10122780Salc * 2. Redistributions in binary form must reproduce the above copyright 11122780Salc * notice, this list of conditions and the following disclaimer in the 12122780Salc * documentation and/or other materials provided with the distribution. 13122780Salc * 14122780Salc * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15122780Salc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16122780Salc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17122780Salc * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18122780Salc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19122780Salc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20122780Salc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21122780Salc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22122780Salc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23122780Salc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24122780Salc * SUCH DAMAGE. 25122780Salc * 26122780Salc * $FreeBSD: head/sys/i386/include/sf_buf.h 122780 2003-11-16 06:11:26Z alc $ 27122780Salc */ 28122780Salc 29122780Salc#ifndef _MACHINE_SF_BUF_H_ 30122780Salc#define _MACHINE_SF_BUF_H_ 31122780Salc 32122780Salc#include <sys/queue.h> 33122780Salc 34122780Salcstruct vm_page; 35122780Salc 36122780Salcstruct sf_buf { 37122780Salc SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ 38122780Salc struct vm_page *m; /* currently mapped page */ 39122780Salc vm_offset_t kva; /* va of mapping */ 40122780Salc}; 41122780Salc 42122780Salcstatic __inline vm_offset_t 43122780Salcsf_buf_kva(struct sf_buf *sf) 44122780Salc{ 45122780Salc 46122780Salc return (sf->kva); 47122780Salc} 48122780Salc 49122780Salcstatic __inline struct vm_page * 50122780Salcsf_buf_page(struct sf_buf *sf) 51122780Salc{ 52122780Salc 53122780Salc return (sf->m); 54122780Salc} 55122780Salc 56122780Salc#endif /* !_MACHINE_SF_BUF_H_ */ 57