mmzone.h 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SH_MMZONE_H
  3. #define __ASM_SH_MMZONE_H
  4. #ifdef CONFIG_NUMA
  5. #include <linux/numa.h>
  6. static inline int pfn_to_nid(unsigned long pfn)
  7. {
  8. int nid;
  9. for (nid = 0; nid < MAX_NUMNODES; nid++)
  10. if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
  11. break;
  12. return nid;
  13. }
  14. static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
  15. {
  16. return NODE_DATA(pfn_to_nid(pfn));
  17. }
  18. /* arch/sh/mm/numa.c */
  19. void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
  20. #else
  21. static inline void
  22. setup_bootmem_node(int nid, unsigned long start, unsigned long end)
  23. {
  24. }
  25. #endif /* CONFIG_NUMA */
  26. /* Platform specific mem init */
  27. void __init plat_mem_setup(void);
  28. /* arch/sh/kernel/setup.c */
  29. void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
  30. unsigned long end_pfn);
  31. /* arch/sh/mm/init.c */
  32. void __init allocate_pgdat(unsigned int nid);
  33. #endif /* __ASM_SH_MMZONE_H */