X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fmmzone.h;h=d95b7c240831656ffebeadf4e2cae47ee3646054;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=53c62171a7c2c5f262315523388fe865685c2331;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 53c62171a..d95b7c240 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h @@ -12,7 +12,6 @@ #include -#define MAXNODE 8 #define NODEMAPSIZE 0xff /* Simple perfect hash to map physical addresses to node numbers */ @@ -57,9 +56,8 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) #define page_to_pfn(page) \ (long)(((page) - page_zone(page)->zone_mem_map) + page_zone(page)->zone_start_pfn) -/* AK: !DISCONTIGMEM just forces it to 1. Can't we too? */ -#define pfn_valid(pfn) ((pfn) < num_physpages) - - +#define pfn_valid(pfn) ((pfn) >= num_physpages ? 0 : \ + ({ u8 nid__ = pfn_to_nid(pfn); \ + nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) <= node_end_pfn(nid__); })) #endif #endif