Linux Audio

Check our new training course

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