summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/sf_buf.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-08-05 09:44:10 +0000
committerglebius <glebius@FreeBSD.org>2014-08-05 09:44:10 +0000
commit991a1f338d51c4c8f87ae530a1142a92f1626c96 (patch)
tree4d877314a59ae549347eb85276851e4a8dce37a7 /sys/i386/include/sf_buf.h
parent7cb9d0139b7fbaa1a047ddb52ee3674df1c313f4 (diff)
downloadFreeBSD-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/i386/include/sf_buf.h')
-rw-r--r--sys/i386/include/sf_buf.h39
1 files changed, 4 insertions, 35 deletions
diff --git a/sys/i386/include/sf_buf.h b/sys/i386/include/sf_buf.h
index 20296b3..f1f1cd3 100644
--- a/sys/i386/include/sf_buf.h
+++ b/sys/i386/include/sf_buf.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003, 2005 Alan L. Cox <alc@cs.rice.edu>
+ * Copyright (c) 2014 Gleb Smirnoff <glebius@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,39 +29,8 @@
#ifndef _MACHINE_SF_BUF_H_
#define _MACHINE_SF_BUF_H_
-#include <sys/_cpuset.h>
-#include <sys/queue.h>
-
-struct vm_page;
-
-struct sf_buf {
- LIST_ENTRY(sf_buf) list_entry; /* list of buffers */
- TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */
- struct vm_page *m; /* currently mapped page */
- vm_offset_t kva; /* va of mapping */
- int ref_count; /* usage of this mapping */
-#ifdef SMP
- cpuset_t cpumask; /* cpus on which mapping is valid */
-#endif
-};
-
-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);
-}
-
-boolean_t sf_buf_invalidate_cache(vm_page_t m);
+void sf_buf_map(struct sf_buf *, int);
+int sf_buf_unmap(struct sf_buf *);
+boolean_t sf_buf_invalidate_cache(vm_page_t);
#endif /* !_MACHINE_SF_BUF_H_ */
OpenPOWER on IntegriCloud