Re: Use of __pa() with CONFIG_NONLINEAR

Joel Schopp
2004-07-28T16:27:21Z

> 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))