1 #ifndef _PARISC_MMZONE_H
2 #define _PARISC_MMZONE_H
3 
4 struct node_map_data {
5     pg_data_t pg_data;
6     struct page *adj_node_mem_map;
7 };
8 
9 extern struct node_map_data node_data[];
10 extern unsigned char *chunkmap;
11 
12 #define BADCHUNK                ((unsigned char)0xff)
13 #define CHUNKSZ                 (256*1024*1024)
14 #define CHUNKSHIFT              28
15 #define CHUNKMASK               (~(CHUNKSZ - 1))
16 #define CHUNKNUM(paddr)         ((paddr) >> CHUNKSHIFT)
17 
18 #define NODE_DATA(nid)          (&node_data[nid].pg_data)
19 #define NODE_MEM_MAP(nid)       (NODE_DATA(nid)->node_mem_map)
20 #define ADJ_NODE_MEM_MAP(nid)   (node_data[nid].adj_node_mem_map)
21 
22 #define phys_to_page(paddr) \
23 	(ADJ_NODE_MEM_MAP(chunkmap[CHUNKNUM((paddr))]) \
24 	+ ((paddr) >> PAGE_SHIFT))
25 
26 #define virt_to_page(kvaddr) phys_to_page(__pa(kvaddr))
27 
28 /* This is kind of bogus, need to investigate performance of doing it right */
29 #define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
30 
31 #endif /* !_PARISC_MMZONE_H */
32