diff options
-rw-r--r-- | arch/x86/machine/pmap.c | 2 | ||||
-rw-r--r-- | vm/vm_page.c | 11 | ||||
-rw-r--r-- | vm/vm_page.h | 13 |
3 files changed, 16 insertions, 10 deletions
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c index bf053763..80098cea 100644 --- a/arch/x86/machine/pmap.c +++ b/arch/x86/machine/pmap.c @@ -1020,7 +1020,7 @@ pmap_enter_ptemap(struct pmap *pmap, unsigned long va, phys_addr_t pa, int prot) if (*pte != 0) continue; - if (!vm_page_ready) { + if (!vm_page_ready()) { assert(pmap == kernel_pmap); ptp_pa = vm_page_bootalloc(); } else { diff --git a/vm/vm_page.c b/vm/vm_page.c index 8ff703e0..b3c5f8da 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 c943be5e..ddd0a239 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 |