diff options
author | alc <alc@FreeBSD.org> | 2004-04-18 08:10:04 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-04-18 08:10:04 +0000 |
commit | 3edd6abfa67cf49f0fde3bab46cb131e8ff02f3d (patch) | |
tree | 981555c65fa7ba0b4f90efaa36b18352c1e118c0 /sys/powerpc/include/sf_buf.h | |
parent | 9b6badb0bdb6fca79c577ba943a04ec3028db7c0 (diff) | |
download | FreeBSD-src-3edd6abfa67cf49f0fde3bab46cb131e8ff02f3d.zip FreeBSD-src-3edd6abfa67cf49f0fde3bab46cb131e8ff02f3d.tar.gz |
MFamd64
Simplify the sf_buf implementation. In short, make it a veneer
over the direct virtual-to-physical mapping.
Diffstat (limited to 'sys/powerpc/include/sf_buf.h')
-rw-r--r-- | sys/powerpc/include/sf_buf.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/powerpc/include/sf_buf.h b/sys/powerpc/include/sf_buf.h index b6ee1cc..6997419 100644 --- a/sys/powerpc/include/sf_buf.h +++ b/sys/powerpc/include/sf_buf.h @@ -29,28 +29,30 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#include <sys/queue.h> - -struct vm_page; - -struct sf_buf { - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ - struct vm_page *m; /* currently mapped page */ - vm_offset_t kva; /* va of mapping */ -}; +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/vm_page.h> + +/* + * 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; static __inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { - return (sf->kva); + return (VM_PAGE_TO_PHYS((vm_page_t)sf)); } -static __inline struct vm_page * +static __inline vm_page_t sf_buf_page(struct sf_buf *sf) { - return (sf->m); + return ((vm_page_t)sf); } #endif /* !_MACHINE_SF_BUF_H_ */ |