Re: [PATCH] cleanup hardcoding __pa/__va macros etc.

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

 



On Sun, 24 Sep 2006 14:39:38 +0900, girish <girishvg@xxxxxxxxx> wrote:
> --- linux-vanilla/include/asm-mips/page.h	2006-09-24 12:23:34.000000000 +0900
> +++ linux/include/asm-mips/page.h	2006-09-24 14:00:53.000000000 +0900
> @@ -134,8 +134,13 @@ typedef struct { unsigned long pgprot; }
>  /* to align the pointer to the (next) page boundary */
>  #define PAGE_ALIGN(addr)	(((addr) + PAGE_SIZE - 1) & PAGE_MASK)
> 
> -#define __pa(x)			((unsigned long) (x) - PAGE_OFFSET)
> -#define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
> +#define UNMAPLIMIT              (UNCAC_BASE - CAC_BASE) /*HIGHMEM_START*/
> +#define ISMAPPED(x)             (KSEGX((x)) > UNMAPLIMIT)
> +#define ___pa(x)		((unsigned long) (x) - PAGE_OFFSET)
> +#define __pa(x)		        (ISMAPPED(x) ? (x) : ___pa(x))
> +
> +#define ___va(x)		((void *)((unsigned long) (x) + PAGE_OFFSET))
> +#define __va(x)			(ISMAPPED(x) ? (x) : ___va(x))
> 
>  #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)

This part looks broken for 64-bit kernel.

For other parts, it would be better to keep correct indentation level.

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