Re: [PATCH] cleanup hardcoding __pa/__va macros etc. (take-2)

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

 



Here is the patch again, attached as a text file. I don't have idea how
these macros should be on a 64bit machine, so I just left them as it is.
Could you please verify these macros again?


On 9/25/06 12:26 AM, "Atsushi Nemoto" <anemo@xxxxxxxxxxxxx> wrote:

> 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

Attachment: patch-basicfix-20060925
Description: Binary data


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

  Powered by Linux