From 1aa429d4f58593c8fbc0cdd67a63145e8d42ee09 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Thu, 26 Jul 2018 16:14:21 +0900 Subject: [PATCH] init_normal_area: fix warnings - unused variable pt_phys - undeclared function set_pt_large_page (move definition lower) Change-Id: I4625b70efe8e914160b17064078c42b86a461d3e --- arch/x86_64/kernel/memory.c | 41 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/arch/x86_64/kernel/memory.c b/arch/x86_64/kernel/memory.c index 2c454511..5a4b378c 100644 --- a/arch/x86_64/kernel/memory.c +++ b/arch/x86_64/kernel/memory.c @@ -165,27 +165,6 @@ static unsigned long setup_l3(struct page_table *pt, return virt_to_phys(pt); } -static void init_normal_area(struct page_table *pt) -{ - unsigned long map_start, map_end, phys, pt_phys; - void *virt; - - map_start = ihk_mc_get_memory_address(IHK_MC_GMA_MAP_START, 0); - map_end = ihk_mc_get_memory_address(IHK_MC_GMA_MAP_END, 0); - virt = (void *)MAP_ST_START + map_start; - - kprintf("map_start = %lx, map_end = %lx, virt %lx\n", - map_start, map_end, virt); - - for (phys = map_start; phys < map_end; phys += LARGE_PAGE_SIZE) { - if (set_pt_large_page(pt, virt, phys, PTATTR_WRITABLE) != 0) { - kprintf("%s: error setting mapping for 0x%lx\n", - __func__, virt); - } - virt += LARGE_PAGE_SIZE; - } -} - static struct page_table *__alloc_new_pt(ihk_mc_ap_flag ap_flag) { struct page_table *newpt = ihk_mc_alloc_pages(1, ap_flag); @@ -2540,6 +2519,26 @@ static void init_fixed_area(struct page_table *pt) return; } +static void init_normal_area(struct page_table *pt) +{ + unsigned long map_start, map_end, phys; + void *virt; + + map_start = ihk_mc_get_memory_address(IHK_MC_GMA_MAP_START, 0); + map_end = ihk_mc_get_memory_address(IHK_MC_GMA_MAP_END, 0); + virt = (void *)MAP_ST_START + map_start; + + kprintf("map_start = %lx, map_end = %lx, virt %lx\n", + map_start, map_end, virt); + + for (phys = map_start; phys < map_end; phys += LARGE_PAGE_SIZE) { + if (set_pt_large_page(pt, virt, phys, PTATTR_WRITABLE) != 0) { + kprintf("%s: error setting mapping for 0x%lx\n", + __func__, virt); + } + virt += LARGE_PAGE_SIZE; + } +} void init_text_area(struct page_table *pt) { unsigned long __end, phys, virt;