diff options
author | glebius <glebius@FreeBSD.org> | 2014-08-05 09:44:10 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-08-05 09:44:10 +0000 |
commit | 991a1f338d51c4c8f87ae530a1142a92f1626c96 (patch) | |
tree | 4d877314a59ae549347eb85276851e4a8dce37a7 /sys/amd64 | |
parent | 7cb9d0139b7fbaa1a047ddb52ee3674df1c313f4 (diff) | |
download | FreeBSD-src-991a1f338d51c4c8f87ae530a1142a92f1626c96.zip FreeBSD-src-991a1f338d51c4c8f87ae530a1142a92f1626c96.tar.gz |
Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c
The MD allocators were very common, however there were some minor
differencies. These differencies were all consolidated in the MI allocator,
under ifdefs. The defines from machine/vmparam.h turn on features required
for a particular machine. For details look in the comment in sys/sf_buf.h.
As result no MD code left in sys/*/*/vm_machdep.c. Some arches still have
machine/sf_buf.h, which is usually quite small.
Tested by: glebius (i386), tuexen (arm32), kevlo (arm32)
Reviewed by: kib
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/sf_buf.h | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/sys/amd64/include/sf_buf.h b/sys/amd64/include/sf_buf.h index 729e8e5..00b3085 100644 --- a/sys/amd64/include/sf_buf.h +++ b/sys/amd64/include/sf_buf.h @@ -29,42 +29,23 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#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 struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) -{ - - return ((struct sf_buf *)m); -} - -static inline void -sf_buf_free(struct sf_buf *sf) -{ -} - -static __inline vm_offset_t +static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); } -static __inline vm_page_t +static inline vm_page_t sf_buf_page(struct sf_buf *sf) { return ((vm_page_t)sf); } - #endif /* !_MACHINE_SF_BUF_H_ */ |