summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/sf_buf.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-04-18 05:36:37 +0000
committeralc <alc@FreeBSD.org>2004-04-18 05:36:37 +0000
commitf2547e07b8e57ebf59a38a71d7090b9b527d3b71 (patch)
tree6bb644ee61f3b2bafa77559232bdc0407f437521 /sys/amd64/include/sf_buf.h
parent6cd0e4679af1e52dd9a0f8e3a8136340cf8c9c03 (diff)
downloadFreeBSD-src-f2547e07b8e57ebf59a38a71d7090b9b527d3b71.zip
FreeBSD-src-f2547e07b8e57ebf59a38a71d7090b9b527d3b71.tar.gz
Simplify the sf_buf implementation. In short, make it a trivial veneer
over the direct virtual-to-physical mapping.
Diffstat (limited to 'sys/amd64/include/sf_buf.h')
-rw-r--r--sys/amd64/include/sf_buf.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/amd64/include/sf_buf.h b/sys/amd64/include/sf_buf.h
index 7fd1a64..aacd6c5 100644
--- a/sys/amd64/include/sf_buf.h
+++ b/sys/amd64/include/sf_buf.h
@@ -29,29 +29,30 @@
#ifndef _MACHINE_SF_BUF_H_
#define _MACHINE_SF_BUF_H_
-#include <sys/queue.h>
-
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_page.h>
-struct sf_buf {
- SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
- vm_page_t m; /* currently mapped 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;
static __inline vm_offset_t
sf_buf_kva(struct sf_buf *sf)
{
- return (PHYS_TO_DMAP(sf->m->phys_addr));
+ return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf)));
}
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_ */
OpenPOWER on IntegriCloud