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/mips/include/sf_buf.h | |
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/mips/include/sf_buf.h')
-rw-r--r-- | sys/mips/include/sf_buf.h | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/sys/mips/include/sf_buf.h b/sys/mips/include/sf_buf.h index e5d981f..76fb993 100644 --- a/sys/mips/include/sf_buf.h +++ b/sys/mips/include/sf_buf.h @@ -29,31 +29,9 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#ifdef __mips_n64 -#include <vm/vm.h> -#include <vm/vm_param.h> -#include <vm/vm_page.h> -#else -#include <sys/queue.h> -#endif +#ifdef __mips_n64 /* In 64 bit the whole memory is directly mapped */ -#ifdef __mips_n64 -/* In 64 bit the whole memory is directly mapped */ -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) { vm_page_t m; @@ -62,38 +40,12 @@ sf_buf_kva(struct sf_buf *sf) return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); } -static __inline struct vm_page * +static inline struct vm_page * sf_buf_page(struct sf_buf *sf) { return ((vm_page_t)sf); } -#else /* ! __mips_n64 */ -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 */ -}; - -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); -void sf_buf_free(struct sf_buf *sf); - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) -{ - - return (sf->kva); -} - -static __inline struct vm_page * -sf_buf_page(struct sf_buf *sf) -{ - - return (sf->m); -} #endif /* __mips_n64 */ - #endif /* !_MACHINE_SF_BUF_H_ */ |