linux-mips
[Top] [All Lists]

Re: PATCH

To: Pete Popov <ppopov@embeddedalley.com>
Subject: Re: PATCH
From: Pete Popov <ppopov@embeddedalley.com>
Date: Mon, 11 Oct 2004 11:04:05 -0700
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, macro@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <416AB5DF.70209@embeddedalley.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1097452888.4627.25.camel@localhost.localdomain> <Pine.LNX.4.58L.0410110126120.4217@blysk.ds.pg.gda.pl> <4169D818.5020802@embeddedalley.com> <20041011.225341.59463723.anemo@mba.ocn.ne.jp> <416AB5DF.70209@embeddedalley.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
Pete Popov wrote:
Atsushi Nemoto wrote:

On Sun, 10 Oct 2004 17:47:20 -0700, Pete Popov <ppopov@embeddedalley.com> said:



ppopov> Clearly a buglet, carried over from 2.4. That section of the
ppopov> code wouldn't even be compiled, since CONFIG_MIPS64 is not
ppopov> defined. I'll remove that and send a new patch. Anything else
ppopov> you see that's suspicious :)?

Hi.  I wonder why following change is needed.


--- include/asm-mips/page.h    20 Aug 2004 12:02:18 -0000    1.44
+++ include/asm-mips/page.h    19 Sep 2004 22:51:29 -0000
@@ -32,7 +32,7 @@
#ifdef CONFIG_PAGE_SIZE_64KB
#define PAGE_SHIFT    16
#endif
-#define PAGE_SIZE    (1UL << PAGE_SHIFT)
+#define PAGE_SIZE    (1L << PAGE_SHIFT)
#define PAGE_MASK    (~(PAGE_SIZE-1))

#ifdef __KERNEL__


It was related to some compiler problem I mentioned to Ralf sometime ago. Perhaps it's not needed anymore, I'll take a look.

Turns out the problem is with the #define PAGE_MASK, when (1UL << PAGE_SHIFT) is used for PAGE_SIZE. The correct fix is already in the PPC tree and it doesn't use PAGE_SIZE to define PAGE_MASK. From the PPC tree:

/*
 * Subtle: this is an int (not an unsigned long) and so it
 * gets extended to 64 bits the way [we] want (i.e. with 1s).  -- paulus
 */
#define PAGE_MASK       (~((1 << PAGE_SHIFT) - 1))

I updated the patch and put a new version in my directory (v1.3). The diff is:

-#define PAGE_MASK      (~(PAGE_SIZE-1))
+#define PAGE_MASK       (~((1 << PAGE_SHIFT) - 1))

I'll work on the remap_pfn_range after those bits get to kernel.org. That will clean up the patch nicely.

Pete



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