]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen: move declaration of first_valid_mfn to xen/numa.h
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Mon, 18 Dec 2023 15:06:12 +0000 (16:06 +0100)
committerStefano Stabellini <stefano.stabellini@amd.com>
Wed, 20 Dec 2023 01:09:57 +0000 (17:09 -0800)
Such declaration is moved in order to provide it for Arm and PPC,
whilst not violating MISRA C:2012 Rule 8.4 in common/page_alloc.c:
"A compatible declaration shall be visible when an object or
function with external linkage is defined".

Signed-off-by: Julien Grall <julien@xen.org>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/include/asm/numa.h
xen/arch/ppc/include/asm/numa.h
xen/common/page_alloc.c
xen/include/xen/numa.h

index e2bee2bd8223bfb7cb584c12728b37a699572cfe..a2c1da4a82f7b36af2ac9c846e6359bb41d857e8 100644 (file)
@@ -11,12 +11,6 @@ typedef u8 nodeid_t;
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 
-/*
- * TODO: make first_valid_mfn static when NUMA is supported on Arm, this
- * is required because the dummy helpers are using it.
- */
-extern mfn_t first_valid_mfn;
-
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn))
 #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
index 7fdf66c3da74b5d3f3b2d09c35e2bd7c7322d412..204180ad5b98acfca83929816c638759be024944 100644 (file)
@@ -10,12 +10,6 @@ typedef uint8_t nodeid_t;
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 
-/*
- * TODO: make first_valid_mfn static when NUMA is supported on PPC, this
- * is required because the dummy helpers are using it.
- */
-extern mfn_t first_valid_mfn;
-
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn))
 #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
index 9b5df74fddabbfac7923058fcd14ff3a8d8f11c0..d874525916eaa7d598e6a02a4d2879dc62be9a80 100644 (file)
@@ -255,8 +255,10 @@ static PAGE_LIST_HEAD(page_broken_list);
  */
 
 /*
- * first_valid_mfn is exported because it is use in ARM specific NUMA
- * helpers. See comment in arch/arm/include/asm/numa.h.
+ * first_valid_mfn is exported because it is used when !CONFIG_NUMA.
+ *
+ * TODO: Consider if we can conditionally export first_valid_mfn based
+ * on whether NUMA is selected.
  */
 mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
 
index 287e81ff6666478a132ae053a8223cf9312deaf9..a10d4b1778a09e0a465d9d54d21a1bbc6707f0ac 100644 (file)
@@ -108,6 +108,8 @@ extern void numa_set_processor_nodes_parsed(nodeid_t node);
 
 #else
 
+extern mfn_t first_valid_mfn;
+
 static inline nodeid_t mfn_to_nid(mfn_t mfn)
 {
     return 0;