patch-2.4.20 linux-2.4.20/include/asm-parisc/mmzone.h
Next file: linux-2.4.20/include/asm-parisc/module.h
Previous file: linux-2.4.20/include/asm-parisc/mmu_context.h
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Thu Nov 28 15:53:15 2002
- Orig file:
linux-2.4.19/include/asm-parisc/mmzone.h
- Orig date:
Wed Dec 31 16:00:00 1969
diff -urN linux-2.4.19/include/asm-parisc/mmzone.h linux-2.4.20/include/asm-parisc/mmzone.h
@@ -0,0 +1,31 @@
+#ifndef _PARISC_MMZONE_H
+#define _PARISC_MMZONE_H
+
+struct node_map_data {
+ pg_data_t pg_data;
+ struct page *adj_node_mem_map;
+};
+
+extern struct node_map_data node_data[];
+extern unsigned char *chunkmap;
+
+#define BADCHUNK ((unsigned char)0xff)
+#define CHUNKSZ (256*1024*1024)
+#define CHUNKSHIFT 28
+#define CHUNKMASK (~(CHUNKSZ - 1))
+#define CHUNKNUM(paddr) ((paddr) >> CHUNKSHIFT)
+
+#define NODE_DATA(nid) (&node_data[nid].pg_data)
+#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
+#define ADJ_NODE_MEM_MAP(nid) (node_data[nid].adj_node_mem_map)
+
+#define phys_to_page(paddr) \
+ (ADJ_NODE_MEM_MAP(chunkmap[CHUNKNUM((paddr))]) \
+ + ((paddr) >> PAGE_SHIFT))
+
+#define virt_to_page(kvaddr) phys_to_page(__pa(kvaddr))
+
+/* This is kind of bogus, need to investigate performance of doing it right */
+#define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
+
+#endif /* !_PARISC_MMZONE_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)