[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen: move declaration of first_valid_mfn to xen/numa.h
commit 51ffb33118954574bfd47025a5bc1114bbcf58cd Author: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> AuthorDate: Mon Dec 18 16:06:12 2023 +0100 Commit: Stefano Stabellini <stefano.stabellini@xxxxxxx> CommitDate: Tue Dec 19 17:09:57 2023 -0800 xen: move declaration of first_valid_mfn to xen/numa.h 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@xxxxxxx> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/arch/arm/include/asm/numa.h | 6 ------ xen/arch/ppc/include/asm/numa.h | 6 ------ xen/common/page_alloc.c | 6 ++++-- xen/include/xen/numa.h | 2 ++ 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index e2bee2bd82..a2c1da4a82 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -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)) diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/numa.h index 7fdf66c3da..204180ad5b 100644 --- a/xen/arch/ppc/include/asm/numa.h +++ b/xen/arch/ppc/include/asm/numa.h @@ -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)) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 9b5df74fdd..d874525916 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -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; diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 287e81ff66..a10d4b1778 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -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; -- generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |