mmzone.h 1.1 KB

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