diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2008-07-28 23:02:13 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@hera.kernel.org> | 2008-10-10 12:32:29 -0400 |
commit | deae26bf6a10e47983606f5df080b91e97650ead (patch) | |
tree | 84a8a68145d0f713d7c5a1f9e6b3b03be9b3a4c8 /include/asm-parisc/mmzone.h | |
parent | 6c86cb8237bf08443806089130dc108051569a93 (diff) |
parisc: move include/asm-parisc to arch/parisc/include/asm
Diffstat (limited to 'include/asm-parisc/mmzone.h')
-rw-r--r-- | include/asm-parisc/mmzone.h | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h deleted file mode 100644 index 9608d2cf214a..000000000000 --- a/include/asm-parisc/mmzone.h +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | #ifndef _PARISC_MMZONE_H | ||
2 | #define _PARISC_MMZONE_H | ||
3 | |||
4 | #ifdef CONFIG_DISCONTIGMEM | ||
5 | |||
6 | #define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */ | ||
7 | extern int npmem_ranges; | ||
8 | |||
9 | struct node_map_data { | ||
10 | pg_data_t pg_data; | ||
11 | }; | ||
12 | |||
13 | extern struct node_map_data node_data[]; | ||
14 | |||
15 | #define NODE_DATA(nid) (&node_data[nid].pg_data) | ||
16 | |||
17 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | ||
18 | #define node_end_pfn(nid) \ | ||
19 | ({ \ | ||
20 | pg_data_t *__pgdat = NODE_DATA(nid); \ | ||
21 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ | ||
22 | }) | ||
23 | |||
24 | /* We have these possible memory map layouts: | ||
25 | * Astro: 0-3.75, 67.75-68, 4-64 | ||
26 | * zx1: 0-1, 257-260, 4-256 | ||
27 | * Stretch (N-class): 0-2, 4-32, 34-xxx | ||
28 | */ | ||
29 | |||
30 | /* Since each 1GB can only belong to one region (node), we can create | ||
31 | * an index table for pfn to nid lookup; each entry in pfnnid_map | ||
32 | * represents 1GB, and contains the node that the memory belongs to. */ | ||
33 | |||
34 | #define PFNNID_SHIFT (30 - PAGE_SHIFT) | ||
35 | #define PFNNID_MAP_MAX 512 /* support 512GB */ | ||
36 | extern unsigned char pfnnid_map[PFNNID_MAP_MAX]; | ||
37 | |||
38 | #ifndef CONFIG_64BIT | ||
39 | #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT)) | ||
40 | #else | ||
41 | /* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */ | ||
42 | #define pfn_is_io(pfn) ((pfn & (0xf000000000000000UL >> PAGE_SHIFT)) == (0xf000000000000000UL >> PAGE_SHIFT)) | ||
43 | #endif | ||
44 | |||
45 | static inline int pfn_to_nid(unsigned long pfn) | ||
46 | { | ||
47 | unsigned int i; | ||
48 | unsigned char r; | ||
49 | |||
50 | if (unlikely(pfn_is_io(pfn))) | ||
51 | return 0; | ||
52 | |||
53 | i = pfn >> PFNNID_SHIFT; | ||
54 | BUG_ON(i >= sizeof(pfnnid_map) / sizeof(pfnnid_map[0])); | ||
55 | r = pfnnid_map[i]; | ||
56 | BUG_ON(r == 0xff); | ||
57 | |||
58 | return (int)r; | ||
59 | } | ||
60 | |||
61 | static inline int pfn_valid(int pfn) | ||
62 | { | ||
63 | int nid = pfn_to_nid(pfn); | ||
64 | |||
65 | if (nid >= 0) | ||
66 | return (pfn < node_end_pfn(nid)); | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | #else /* !CONFIG_DISCONTIGMEM */ | ||
71 | #define MAX_PHYSMEM_RANGES 1 | ||
72 | #endif | ||
73 | #endif /* _PARISC_MMZONE_H */ | ||