summaryrefslogtreecommitdiff
path: root/vm/vm_page.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-01-11 22:20:49 +0100
committerRichard Braun <rbraun@sceen.net>2017-01-11 23:14:22 +0100
commit436cf120107a79f0cd27d5ea4929a0a16dd8177f (patch)
tree219765b359cd8104dcd902fb4c25ab684f4b5613 /vm/vm_page.h
parent135f428f0a50eb9988f0b40a60357dfedbcc7f18 (diff)
vm/vm_page: provide accessors to private data
Make per-page private data generic, provide accessors, and make the slab allocator use them.
Diffstat (limited to 'vm/vm_page.h')
-rw-r--r--vm/vm_page.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/vm/vm_page.h b/vm/vm_page.h
index 097bcc6b..1ce172f2 100644
--- a/vm/vm_page.h
+++ b/vm/vm_page.h
@@ -76,7 +76,7 @@ struct vm_page {
unsigned short seg_index;
unsigned short order;
phys_addr_t phys_addr;
- void *slab_priv;
+ void *priv;
};
static inline unsigned short
@@ -122,6 +122,21 @@ vm_page_direct_ptr(const struct vm_page *page)
}
/*
+ * Associate private data with a page.
+ */
+static inline void
+vm_page_set_priv(struct vm_page *page, void *priv)
+{
+ page->priv = priv;
+}
+
+static inline void *
+vm_page_get_priv(const struct vm_page *page)
+{
+ return page->priv;
+}
+
+/*
* Load physical memory into the vm_page module at boot time.
*
* All addresses must be page-aligned. Segments can be loaded in any order.