[Top] [All Lists]

Re: One good and some bad news

Subject: Re: One good and some bad news
From: Thomas Bogendoerfer <>
Date: Sun, 12 Jul 1998 20:55:23 +0200
In-reply-to: <>; from Thomas Bogendoerfer on Sun, Jul 12, 1998 at 11:29:49AM +0200
References: <>
On Sun, Jul 12, 1998 at 11:29:49AM +0200, Thomas Bogendoerfer wrote:
> This was the first bad news. To get XF68_FBDev to work, I had to
> discover, that the logic with MAP_MASK is broken. When you look in

ok, I've found a solution for this problem by just using what the other
ports are using for MAP_NR(). I also fixed the mk_pte_phys(), which was
broken, too. Below is the patch I'm currently using. The problem with
the dbe after quiting the X server, didn't happen again. 


Index: include/asm/page.h
RCS file: /var/mips/linus/cvs/linux/include/asm-mips/page.h,v
retrieving revision
diff -u -r1.1.1.1 page.h
--- page.h      1997/06/01 03:17:11
+++ page.h      1998/07/12 18:50:11
@@ -76,8 +76,7 @@
 #define PAGE_OFFSET    0x80000000UL
 #define __pa(x)                ((unsigned long) (x) - PAGE_OFFSET)
 #define __va(x)                ((void *)((unsigned long) (x) + PAGE_OFFSET))
-#define MAP_MASK        0x1fffffffUL
-#define MAP_NR(addr)   ((((unsigned long)(addr)) & MAP_MASK) >> PAGE_SHIFT)
+#define MAP_NR(addr)   (__pa(addr) >> PAGE_SHIFT)
 #endif /* defined (__KERNEL__) */
Index: include/asm/pgtable.h
RCS file: /var/mips/linus/cvs/linux/include/asm-mips/pgtable.h,v
retrieving revision 1.11
diff -u -r1.11 pgtable.h
--- pgtable.h   1998/03/17 22:16:15     1.11
+++ pgtable.h   1998/07/12 17:57:22
@@ -346,7 +346,7 @@
 extern inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
-       return __pte((physpage - PAGE_OFFSET) | pgprot_val(pgprot));
+       return __pte(physpage | pgprot_val(pgprot));
 extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)

See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
                   [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]

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