sf_buf.h (11e9b8bad115cf9799076d3add8824862b038563) | sf_buf.h (e45db9b837dc530b86149374e2baeaa775061107) |
---|---|
1/*- | 1/*- |
2 * Copyright (c) 2003, 2005 Alan L. Cox <alc@cs.rice.edu> | 2 * Copyright (c) 2003 Alan L. Cox <alc@cs.rice.edu> |
3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 18 unchanged lines hidden (view full) --- 29#ifndef _MACHINE_SF_BUF_H_ 30#define _MACHINE_SF_BUF_H_ 31 32#include <sys/queue.h> 33 34struct vm_page; 35 36struct sf_buf { | 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 18 unchanged lines hidden (view full) --- 29#ifndef _MACHINE_SF_BUF_H_ 30#define _MACHINE_SF_BUF_H_ 31 32#include <sys/queue.h> 33 34struct vm_page; 35 36struct sf_buf { |
37 LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ 38 TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ | 37 SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ |
39 struct vm_page *m; /* currently mapped page */ 40 vm_offset_t kva; /* va of mapping */ | 38 struct vm_page *m; /* currently mapped page */ 39 vm_offset_t kva; /* va of mapping */ |
41 int ref_count; /* usage of this mapping */ 42#ifdef SMP 43 cpumask_t cpumask; /* cpus on which mapping is valid */ 44#endif | |
45}; 46 47static __inline vm_offset_t 48sf_buf_kva(struct sf_buf *sf) 49{ 50 51 return (sf->kva); 52} 53 54static __inline struct vm_page * 55sf_buf_page(struct sf_buf *sf) 56{ 57 58 return (sf->m); 59} 60 | 40}; 41 42static __inline vm_offset_t 43sf_buf_kva(struct sf_buf *sf) 44{ 45 46 return (sf->kva); 47} 48 49static __inline struct vm_page * 50sf_buf_page(struct sf_buf *sf) 51{ 52 53 return (sf->m); 54} 55 |
61boolean_t sf_buf_invalidate_cache(vm_page_t m); 62 | |
63#endif /* !_MACHINE_SF_BUF_H_ */ | 56#endif /* !_MACHINE_SF_BUF_H_ */ |