mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 01:43:18 +00:00
Every architecture that supports NUMA defines node_data in the same way: struct pglist_data *node_data[MAX_NUMNODES]; No reason to keep multiple copies of this definition and its forward declarations, especially when such forward declaration is the only thing in include/asm/mmzone.h for many architectures. Add definition and declaration of node_data to generic code and drop architecture-specific versions. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Acked-by: Davidlohr Bueso <[email protected]> Tested-by: Zi Yan <[email protected]> # for x86_64 and arm64 Tested-by: Jonathan Cameron <[email protected]> [arm64 + CXL via QEMU] Acked-by: Dan Williams <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Andreas Larsson <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Dave Hansen <[email protected]> Cc: David S. Miller <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiaxun Yang <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Rob Herring (Arm) <[email protected]> Cc: Samuel Holland <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
43 lines
970 B
C
43 lines
970 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_SH_MMZONE_H
|
|
#define __ASM_SH_MMZONE_H
|
|
|
|
#ifdef CONFIG_NUMA
|
|
#include <linux/numa.h>
|
|
|
|
static inline int pfn_to_nid(unsigned long pfn)
|
|
{
|
|
int nid;
|
|
|
|
for (nid = 0; nid < MAX_NUMNODES; nid++)
|
|
if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
|
|
break;
|
|
|
|
return nid;
|
|
}
|
|
|
|
static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
|
|
{
|
|
return NODE_DATA(pfn_to_nid(pfn));
|
|
}
|
|
|
|
/* arch/sh/mm/numa.c */
|
|
void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
|
|
#else
|
|
static inline void
|
|
setup_bootmem_node(int nid, unsigned long start, unsigned long end)
|
|
{
|
|
}
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
/* Platform specific mem init */
|
|
void __init plat_mem_setup(void);
|
|
|
|
/* arch/sh/kernel/setup.c */
|
|
void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
|
|
unsigned long end_pfn);
|
|
/* arch/sh/mm/init.c */
|
|
void __init allocate_pgdat(unsigned int nid);
|
|
|
|
#endif /* __ASM_SH_MMZONE_H */
|