powerpc: Delete __cpuinit usage from all users
[linux/fpc-iii.git] / arch / parisc / include / asm / mmzone.h
blobcc50d33b7b881b7c57f7a46c125a56860840e514
1 #ifndef _PARISC_MMZONE_H
2 #define _PARISC_MMZONE_H
4 #define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
6 #ifdef CONFIG_DISCONTIGMEM
8 extern int npmem_ranges;
10 struct node_map_data {
11 pg_data_t pg_data;
14 extern struct node_map_data node_data[];
16 #define NODE_DATA(nid) (&node_data[nid].pg_data)
18 /* We have these possible memory map layouts:
19 * Astro: 0-3.75, 67.75-68, 4-64
20 * zx1: 0-1, 257-260, 4-256
21 * Stretch (N-class): 0-2, 4-32, 34-xxx
24 /* Since each 1GB can only belong to one region (node), we can create
25 * an index table for pfn to nid lookup; each entry in pfnnid_map
26 * represents 1GB, and contains the node that the memory belongs to. */
28 #define PFNNID_SHIFT (30 - PAGE_SHIFT)
29 #define PFNNID_MAP_MAX 512 /* support 512GB */
30 extern unsigned char pfnnid_map[PFNNID_MAP_MAX];
32 #ifndef CONFIG_64BIT
33 #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT))
34 #else
35 /* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */
36 #define pfn_is_io(pfn) ((pfn & (0xf000000000000000UL >> PAGE_SHIFT)) == (0xf000000000000000UL >> PAGE_SHIFT))
37 #endif
39 static inline int pfn_to_nid(unsigned long pfn)
41 unsigned int i;
43 if (unlikely(pfn_is_io(pfn)))
44 return 0;
46 i = pfn >> PFNNID_SHIFT;
47 BUG_ON(i >= ARRAY_SIZE(pfnnid_map));
49 return (int)pfnnid_map[i];
52 static inline int pfn_valid(int pfn)
54 int nid = pfn_to_nid(pfn);
56 if (nid >= 0)
57 return (pfn < node_end_pfn(nid));
58 return 0;
61 #endif
62 #endif /* _PARISC_MMZONE_H */