From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Oliver Pitzeier <o.pitzeier@uptime.at>
Cc: Richard Henderson <rth@twiddle.net>,
"'linux-kernel'" <linux-kernel@vger.kernel.org>
Subject: Re: Problems with mm on Alpha...
Date: Wed, 8 May 2002 14:54:54 +0400 [thread overview]
Message-ID: <20020508145454.A2394@jurassic.park.msu.ru> (raw)
In-Reply-To: <20020508113428.D31998@dualathlon.random> <003701c1f675$3d1c5cc0$010b10ac@sbp.uptime.at>
On Wed, May 08, 2002 at 11:46:28AM +0200, Oliver Pitzeier wrote:
> memory.c:80: warning: implicit declaration of function `pte_pfn'
> memory.c:81: warning: implicit declaration of function `pfn_valid'
> memory.c:83: warning: implicit declaration of function `pfn_to_page'
New pte/pfn/page macros are defined only for i386 as yet.
Patch appended. However, CONFIG_DISCONTIGMEM is still broken in 2.5.
I hope Andrea will take a look into this some day.
Ivan.
--- 2.5.14/include/asm-alpha/page.h Fri May 3 04:22:55 2002
+++ linux/include/asm-alpha/page.h Tue May 7 13:47:53 2002
@@ -95,8 +95,12 @@ extern __inline__ int get_order(unsigned
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#ifndef CONFIG_DISCONTIGMEM
-#define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
-#define VALID_PAGE(page) (((page) - mem_map) < max_mapnr)
+#define pfn_to_page(pfn) (mem_map + (pfn))
+#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
+#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+
+#define pfn_valid(pfn) ((pfn) < max_mapnr)
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#endif /* CONFIG_DISCONTIGMEM */
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
--- 2.5.14/include/asm-alpha/pgtable.h Fri May 3 04:22:46 2002
+++ linux/include/asm-alpha/pgtable.h Wed May 8 14:44:22 2002
@@ -179,11 +179,12 @@ extern unsigned long __zero_page(void);
#endif
#if defined(CONFIG_ALPHA_GENERIC) || \
(defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
-#define PHYS_TWIDDLE(phys) \
- ((((phys) & 0xc0000000000UL) == 0x40000000000UL) \
- ? ((phys) ^= 0xc0000000000UL) : (phys))
+#define KSEG_PFN (0xc0000000000UL >> PAGE_SHIFT)
+#define PHYS_TWIDDLE(pfn) \
+ ((((pfn) & KSEG_PFN) == (0x40000000000UL >> PAGE_SHIFT)) \
+ ? ((pfn) ^= KSEG_PFN) : (pfn))
#else
-#define PHYS_TWIDDLE(phys) (phys)
+#define PHYS_TWIDDLE(pfn) (pfn)
#endif
/*
@@ -199,12 +200,13 @@ extern unsigned long __zero_page(void);
#endif
#ifndef CONFIG_DISCONTIGMEM
+#define pte_pfn(pte) (pte_val(pte) >> 32)
+#define pte_page(pte) pfn_to_page(pte_pfn(pte))
#define mk_pte(page, pgprot) \
({ \
pte_t pte; \
\
- pte_val(pte) = ((unsigned long)(page - mem_map) << 32) | \
- pgprot_val(pgprot); \
+ pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot); \
pte; \
})
#else
@@ -221,8 +223,8 @@ extern unsigned long __zero_page(void);
})
#endif
-extern inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
-{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpage) << (32-PAGE_SHIFT)) | pgprot_val(pgprot); return pte; }
+extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
+{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }
extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
prev parent reply other threads:[~2002-05-08 10:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-04 14:54 2.4.19pre8aa2 Andrea Arcangeli
2002-05-04 15:02 ` 2.4.19pre8aa2 Christoph Hellwig
2002-05-04 23:34 ` 2.4.19pre8aa2 Eyal Lebedinsky
2002-05-05 3:04 ` 2.4.19pre8aa2 Keith Owens
2002-05-05 7:40 ` 2.4.19pre8aa2 Eyal Lebedinsky
2002-05-05 8:04 ` 2.4.19pre8aa2 Keith Owens
2002-05-05 8:16 ` 2.4.19pre8aa2 Keith Owens
2002-05-05 13:38 ` 2.4.19pre8aa2 Eyal Lebedinsky
2002-05-05 0:25 ` 2.4.19pre8aa2 Andrea Arcangeli
2002-05-04 18:56 ` 2.4.19pre8aa2 Francois Romieu
2002-05-05 0:14 ` 2.4.19pre8aa2 Andrea Arcangeli
2002-05-08 2:27 ` 2.4.19pre8aa2 Pozsar Balazs
2002-05-08 9:34 ` 2.4.19pre8aa2 Andrea Arcangeli
2002-05-08 9:46 ` Problems with mm on Alpha Oliver Pitzeier
2002-05-08 10:54 ` Ivan Kokshaysky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020508145454.A2394@jurassic.park.msu.ru \
--to=ink@jurassic.park.msu.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=o.pitzeier@uptime.at \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®