mmzone.h 1.1 KB

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