]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - arch/sh/include/asm/mmzone.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-eoan-kernel.git] / arch / sh / include / asm / mmzone.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
b241cb0c
PM
2#ifndef __ASM_SH_MMZONE_H
3#define __ASM_SH_MMZONE_H
4
5#ifdef __KERNEL__
6
7#ifdef CONFIG_NEED_MULTIPLE_NODES
6bff1592
PM
8#include <linux/numa.h>
9
b241cb0c
PM
10extern struct pglist_data *node_data[];
11#define NODE_DATA(nid) (node_data[nid])
12
b241cb0c
PM
13static inline int pfn_to_nid(unsigned long pfn)
14{
15 int nid;
16
17 for (nid = 0; nid < MAX_NUMNODES; nid++)
18 if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid))
19 break;
20
21 return nid;
22}
23
24static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
25{
26 return NODE_DATA(pfn_to_nid(pfn));
27}
28
29/* arch/sh/mm/numa.c */
30void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end);
31#else
32static inline void
33setup_bootmem_node(int nid, unsigned long start, unsigned long end)
34{
35}
36#endif /* CONFIG_NEED_MULTIPLE_NODES */
37
38/* Platform specific mem init */
39void __init plat_mem_setup(void);
40
41/* arch/sh/kernel/setup.c */
0146ba78
MD
42void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
43 unsigned long end_pfn);
4bc277ac
PM
44/* arch/sh/mm/init.c */
45void __init allocate_pgdat(unsigned int nid);
b241cb0c
PM
46
47#endif /* __KERNEL__ */
48#endif /* __ASM_SH_MMZONE_H */