linux-mips
[Top] [All Lists]

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

To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: [PATCH] cleanup hardcoding __pa/__va macros etc. (take-2)
From: girish <girishvg@gmail.com>
Date: Mon, 25 Sep 2006 23:51:46 +0900
Cc: girish <girishvg@gmail.com>, Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:user-agent:date:subject:from:to:cc:message-id:thread-topic:thread-index:in-reply-to:mime-version:content-type; b=YtDVKWCY/1saSKGOgRWAI6WUpynP4VNpLhxZHkhvyECklxqJXqfJE3Ali1Q25LwVzbK7/5sa8Dv7ygpLyKrLtbGAd7sSlCJLMMjeybVBj+uGeh+EFHH2KbxkFrdpG/YtbFrzMMTyXLYuExKyxtAmDC1O48Sv2pbdq1y/5V/GH/I=
In-reply-to: <20060925.002616.126574366.anemo@mba.ocn.ne.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Thread-index: Acbgsh9EXawEE0ylEdulewATIGIqNA==
Thread-topic: [PATCH] cleanup hardcoding __pa/__va macros etc. (take-2)
User-agent: Microsoft-Entourage/11.2.1.051004
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@mba.ocn.ne.jp> wrote:

> On Sun, 24 Sep 2006 14:39:38 +0900, girish <girishvg@gmail.com> 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

<Prev in Thread] Current Thread [Next in Thread>