powerpc: move memstart_addr and kernstart_addr to init-common.c
authorJason Yan <yanaijie@huawei.com>
Fri, 20 Sep 2019 09:45:36 +0000 (17:45 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 13 Nov 2019 08:27:28 +0000 (19:27 +1100)
These two variables are both defined in init_32.c and init_64.c. Move
them to init-common.c and make them __ro_after_init.

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Diana Craciun <diana.craciun@nxp.com>
Tested-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/init-common.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/init_64.c

index a84da92920f797b4e4a96a6417f5a91979ed9dfd..e223da482c0c35b02df1bd6e76420db1fa0c6553 100644 (file)
 #include <asm/pgtable.h>
 #include <asm/kup.h>
 
+phys_addr_t memstart_addr __ro_after_init = (phys_addr_t)~0ull;
+EXPORT_SYMBOL_GPL(memstart_addr);
+phys_addr_t kernstart_addr __ro_after_init;
+EXPORT_SYMBOL_GPL(kernstart_addr);
+
 static bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP);
 static bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP);
 
index b04896a88d792eac665d6e239ccbe86c9f2364a4..872df48ae41bc28dc12085a05229a8d62342aa9f 100644 (file)
 phys_addr_t total_memory;
 phys_addr_t total_lowmem;
 
-phys_addr_t memstart_addr = (phys_addr_t)~0ull;
-EXPORT_SYMBOL(memstart_addr);
-phys_addr_t kernstart_addr;
-EXPORT_SYMBOL(kernstart_addr);
-
 #ifdef CONFIG_RELOCATABLE
 /* Used in __va()/__pa() */
 long long virt_phys_offset;
index 4e08246acd79ad54d81a2acf0c2909475a704e63..28b9596b4b9086e39924013706b7abb205290c77 100644 (file)
 
 #include <mm/mmu_decl.h>
 
-phys_addr_t memstart_addr = ~0;
-EXPORT_SYMBOL_GPL(memstart_addr);
-phys_addr_t kernstart_addr;
-EXPORT_SYMBOL_GPL(kernstart_addr);
-
 #ifdef CONFIG_SPARSEMEM_VMEMMAP
 /*
  * Given an address within the vmemmap, determine the pfn of the page that