Re: [PATCH 2/7] Make __pa() aware of XKPHYS/CKSEG0 address mix for 64 bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Oct 2006 14:39:01 +0200, Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> wrote:
> -#define __pa(x)			((unsigned long) (x) - PAGE_OFFSET)
> -#define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
> +#if defined(CONFIG_64BITS) && !defined(CONFIG_BUILD_ELF64)
> +#define __page_offset(x)	((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
> +#else
> +#define __page_offset(x)	PAGE_OFFSET
> +#endif
> +#define __pa(x)			((unsigned long)(x) - __page_offset(x))
> +#define __va(x)			((void *)((unsigned long)(x) + __page_offset(x)))

In __va(), you are passing an physical address to __page_offset().

---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux