Commit 3fec7922 authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] ia32 NUMA: physnode_map entries can be negative

Based on work from Bill Irwin <wli@holomorphy.com>

physnode_map[] needs to be signed so that pfn_to_nid() can return negative
values used to detect invalid pfn's.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3796df42
...@@ -92,7 +92,7 @@ static void __init initialize_physnode_map(void) ...@@ -92,7 +92,7 @@ static void __init initialize_physnode_map(void)
cur = eq->hi_shrd_mem_start; cur = eq->hi_shrd_mem_start;
topofmem = eq->hi_shrd_mem_start + eq->hi_shrd_mem_size; topofmem = eq->hi_shrd_mem_start + eq->hi_shrd_mem_size;
while (cur < topofmem) { while (cur < topofmem) {
physnode_map[cur >> 8] = nid; physnode_map[cur >> 8] = (s8) nid;
cur ++; cur ++;
} }
} }
......
...@@ -193,7 +193,7 @@ static void __init initialize_physnode_map(void) ...@@ -193,7 +193,7 @@ static void __init initialize_physnode_map(void)
for (pfn = nmcp->start_pfn; pfn <= nmcp->end_pfn; for (pfn = nmcp->start_pfn; pfn <= nmcp->end_pfn;
pfn += PAGES_PER_ELEMENT) pfn += PAGES_PER_ELEMENT)
{ {
physnode_map[pfn / PAGES_PER_ELEMENT] = (int)nmcp->nid; physnode_map[pfn / PAGES_PER_ELEMENT] = (s8) nmcp->nid;
} }
} }
} }
......
...@@ -56,7 +56,7 @@ bootmem_data_t node0_bdata; ...@@ -56,7 +56,7 @@ bootmem_data_t node0_bdata;
* physnode_map[4-7] = 1; * physnode_map[4-7] = 1;
* physnode_map[8- ] = -1; * physnode_map[8- ] = -1;
*/ */
u8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1}; s8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
unsigned long node_start_pfn[MAX_NUMNODES]; unsigned long node_start_pfn[MAX_NUMNODES];
unsigned long node_end_pfn[MAX_NUMNODES]; unsigned long node_end_pfn[MAX_NUMNODES];
......
...@@ -37,12 +37,12 @@ extern struct pglist_data *node_data[]; ...@@ -37,12 +37,12 @@ extern struct pglist_data *node_data[];
#define MAX_ELEMENTS 256 #define MAX_ELEMENTS 256
#define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS) #define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS)
extern u8 physnode_map[]; extern s8 physnode_map[];
static inline int pfn_to_nid(unsigned long pfn) static inline int pfn_to_nid(unsigned long pfn)
{ {
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
return(physnode_map[(pfn) / PAGES_PER_ELEMENT]); return((int) physnode_map[(pfn) / PAGES_PER_ELEMENT]);
#else #else
return 0; return 0;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment