Message ID | 20210923120236.3692135-25-wei.chen@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add device tree based NUMA support to Arm | expand |
On Thu, 23 Sep 2021, Wei Chen wrote: > These two helpers are architecture APIs that are required by > nodes_cover_memory. > > Signed-off-by: Wei Chen <wei.chen@arm.com> > --- > xen/arch/arm/numa.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c > index 3f08870d69..3755b01ef4 100644 > --- a/xen/arch/arm/numa.c > +++ b/xen/arch/arm/numa.c > @@ -67,3 +67,17 @@ uint8_t __node_distance(nodeid_t from, nodeid_t to) > return node_distance_map[from][to]; > } > EXPORT_SYMBOL(__node_distance); > + > +uint32_t __init arch_meminfo_get_nr_bank(void) > +{ > + return bootinfo.mem.nr_banks; > +} > + > +int __init arch_meminfo_get_ram_bank_range(uint32_t bank, > + paddr_t *start, paddr_t *end) > +{ > + *start = bootinfo.mem.bank[bank].start; > + *end = bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size; > + > + return 0; > +} The rest of the file is indented using spaces, while this patch is using tabs. Also, given the implementation, it looks like arch_meminfo_get_ram_bank_range should either return void or bool.
> -----Original Message----- > From: Stefano Stabellini <sstabellini@kernel.org> > Sent: 2021年9月24日 10:06 > To: Wei Chen <Wei.Chen@arm.com> > Cc: xen-devel@lists.xenproject.org; sstabellini@kernel.org; julien@xen.org; > Bertrand Marquis <Bertrand.Marquis@arm.com> > Subject: Re: [PATCH 24/37] xen/arm: implement two arch helpers to get > memory map info > > On Thu, 23 Sep 2021, Wei Chen wrote: > > These two helpers are architecture APIs that are required by > > nodes_cover_memory. > > > > Signed-off-by: Wei Chen <wei.chen@arm.com> > > --- > > xen/arch/arm/numa.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c > > index 3f08870d69..3755b01ef4 100644 > > --- a/xen/arch/arm/numa.c > > +++ b/xen/arch/arm/numa.c > > @@ -67,3 +67,17 @@ uint8_t __node_distance(nodeid_t from, nodeid_t to) > > return node_distance_map[from][to]; > > } > > EXPORT_SYMBOL(__node_distance); > > + > > +uint32_t __init arch_meminfo_get_nr_bank(void) > > +{ > > + return bootinfo.mem.nr_banks; > > +} > > + > > +int __init arch_meminfo_get_ram_bank_range(uint32_t bank, > > + paddr_t *start, paddr_t *end) > > +{ > > + *start = bootinfo.mem.bank[bank].start; > > + *end = bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size; > > + > > + return 0; > > +} > > The rest of the file is indented using spaces, while this patch is using > tabs. > > Also, given the implementation, it looks like > arch_meminfo_get_ram_bank_range should either return void or bool. I will fix them in next version.
diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 3f08870d69..3755b01ef4 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -67,3 +67,17 @@ uint8_t __node_distance(nodeid_t from, nodeid_t to) return node_distance_map[from][to]; } EXPORT_SYMBOL(__node_distance); + +uint32_t __init arch_meminfo_get_nr_bank(void) +{ + return bootinfo.mem.nr_banks; +} + +int __init arch_meminfo_get_ram_bank_range(uint32_t bank, + paddr_t *start, paddr_t *end) +{ + *start = bootinfo.mem.bank[bank].start; + *end = bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size; + + return 0; +}
These two helpers are architecture APIs that are required by nodes_cover_memory. Signed-off-by: Wei Chen <wei.chen@arm.com> --- xen/arch/arm/numa.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)