Re: Use of __pa() with CONFIG_NONLINEAR

From: Joel Schopp
Date: Wed Jul 28 2004 - 11:31:56 EST


This is the largest and hardest to maintain part of the CONFIG_NONLINEAR
patch at this point, and I'd love to start merging bits of it back in. Would anybody object to a patch that just does this for a bunch of
architectures?

I like the idea but would suggest a comment with the #defines to better explain why there are two names for the same thing, how they might in fact be different things in the future, and which one to use where.


--- include/asm-i386/page.h.orig 2004-07-27 14:31:09.000000000 -0700
+++ include/asm-i386/page.h 2004-07-27 14:31:36.000000000 -0700
@@ -128,8 +128,10 @@ static __inline__ int get_order(unsigned
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
#define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
-#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
-#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
+#define __boot_pa(x) ((unsigned long)(x)-PAGE_OFFSET)
+#define __boot_va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
+#define __pa(x) __boot_pa(x)
+#define __va(x) __boot_va(x)
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
#ifndef CONFIG_DISCONTIGMEM
#define pfn_to_page(pfn) (mem_map + (pfn))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/