summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-01-10 23:51:14 +0100
committerRichard Braun <rbraun@sceen.net>2014-01-10 23:51:14 +0100
commit606ac4ebe0debf52f2c29ffd605a9b31754cecde (patch)
tree16ef81f3e7de3a1c9e612b3f94ba361ecf7f0000 /vm
parent539ec2df2487f3607f7ecde2f31e580930ad9ca9 (diff)
vm/vm_page: turn vm_page_ready into a function
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_page.c11
-rw-r--r--vm/vm_page.h13
2 files changed, 15 insertions, 9 deletions
diff --git a/vm/vm_page.c b/vm/vm_page.c
index 8ff703e..b3c5f8d 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -123,8 +123,7 @@ struct vm_page_boot_seg {
phys_addr_t avail_end;
};
-/* TODO Accessor */
-int vm_page_ready __read_mostly;
+static int vm_page_is_ready __read_mostly;
/*
* Segment lists, ordered by priority.
@@ -506,6 +505,12 @@ vm_page_load(const char *name, phys_addr_t start, phys_addr_t end,
vm_page_segs_size++;
}
+int
+vm_page_ready(void)
+{
+ return vm_page_is_ready;
+}
+
phys_addr_t __init
vm_page_bootalloc(void)
{
@@ -585,7 +590,7 @@ vm_page_setup(void)
va += PAGE_SIZE;
}
- vm_page_ready = 1;
+ vm_page_is_ready = 1;
}
void __init
diff --git a/vm/vm_page.h b/vm/vm_page.h
index c943be5..ddd0a23 100644
--- a/vm/vm_page.h
+++ b/vm/vm_page.h
@@ -39,12 +39,6 @@
#define vm_page_aligned(addr) P2ALIGNED(addr, PAGE_SIZE)
/*
- * True if the vm_page module is completely initialized, false otherwise
- * (in which case only vm_page_bootalloc() can be used for allocations).
- */
-extern int vm_page_ready;
-
-/*
* Page usage types.
*
* Types aren't actually used. They merely provide statistics and debugging
@@ -105,6 +99,13 @@ void vm_page_load(const char *name, phys_addr_t start, phys_addr_t end,
unsigned int seg_index, unsigned int seglist_prio);
/*
+ * Return true if the vm_page module is completely initialized, false
+ * otherwise, in which case only vm_page_bootalloc() can be used for
+ * allocations.
+ */
+int vm_page_ready(void);
+
+/*
* Allocate one physical page.
*
* This function is used to allocate physical memory at boot time, before the