This source file includes following definitions.
- pfn_to_nid
- pfn_valid
1
2
3
4
5
6
7 #ifndef _ASM_X86_MMZONE_32_H
8 #define _ASM_X86_MMZONE_32_H
9
10 #include <asm/smp.h>
11
12 #ifdef CONFIG_NUMA
13 extern struct pglist_data *node_data[];
14 #define NODE_DATA(nid) (node_data[nid])
15 #endif
16
17 #ifdef CONFIG_DISCONTIGMEM
18
19
20
21
22
23
24
25
26
27
28 #define MAX_NR_PAGES 16777216
29 #define MAX_SECTIONS 1024
30 #define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS)
31
32 extern s8 physnode_map[];
33
34 static inline int pfn_to_nid(unsigned long pfn)
35 {
36 #ifdef CONFIG_NUMA
37 return((int) physnode_map[(pfn) / PAGES_PER_SECTION]);
38 #else
39 return 0;
40 #endif
41 }
42
43 static inline int pfn_valid(int pfn)
44 {
45 int nid = pfn_to_nid(pfn);
46
47 if (nid >= 0)
48 return (pfn < node_end_pfn(nid));
49 return 0;
50 }
51
52 #define early_pfn_valid(pfn) pfn_valid((pfn))
53
54 #endif
55
56 #endif