Skip to content

Commit

Permalink
x86, mm: Move init_gbpages() out of setup.c
Browse files Browse the repository at this point in the history
Put it in mm/init.c, and call it from probe_page_mask().
init_mem_mapping is calling probe_page_mask at first.
So calling sequence is not changed.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1353123563-3103-32-git-send-email-yinghai@kernel.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Nov 17, 2012
1 parent cf47065 commit 148b209
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
15 changes: 1 addition & 14 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,18 +282,7 @@ void * __init extend_brk(size_t size, size_t align)
return ret;
}

#ifdef CONFIG_X86_64
static void __init init_gbpages(void)
{
if (direct_gbpages && cpu_has_gbpages)
printk(KERN_INFO "Using GB pages for direct mapping\n");
else
direct_gbpages = 0;
}
#else
static inline void init_gbpages(void)
{
}
#ifdef CONFIG_X86_32
static void __init cleanup_highmap(void)
{
}
Expand Down Expand Up @@ -933,8 +922,6 @@ void __init setup_arch(char **cmdline_p)

setup_real_mode();

init_gbpages();

init_mem_mapping();

memblock.current_limit = get_max_mapped();
Expand Down
12 changes: 12 additions & 0 deletions arch/x86/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ int direct_gbpages
#endif
;

static void __init init_gbpages(void)
{
#ifdef CONFIG_X86_64
if (direct_gbpages && cpu_has_gbpages)
printk(KERN_INFO "Using GB pages for direct mapping\n");
else
direct_gbpages = 0;
#endif
}

struct map_range {
unsigned long start;
unsigned long end;
Expand All @@ -108,6 +118,8 @@ static int page_size_mask;

static void __init probe_page_size_mask(void)
{
init_gbpages();

#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
/*
* For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
Expand Down

0 comments on commit 148b209

Please sign in to comment.