mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, galak@freescale.com,
	kumar.gala@freescale.com
Subject: [patch 034/198] ppc32: Allow adjust of pfn offset in pte
Date: Tue, 12 Apr 2005 03:31:05 -0700	[thread overview]
Message-ID: <200504121031.j3CAVBil005257@shell0.pdx.osdl.net> (raw)


From: Kumar Gala <galak@freescale.com>

Allow the pfn to be offset by more than just PAGE_SHIFT in the pte.  Today,
PAGE_SHIFT tends to allow us to have 12-bits of flags in the pte.  In the
future if we have a larger pte we can allocate more bits for flags by
offsetting the pfn even further.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/asm-ppc/pgtable.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -puN include/asm-ppc/pgtable.h~ppc32-allow-adjust-of-pfn-offset-in-pte include/asm-ppc/pgtable.h
--- 25/include/asm-ppc/pgtable.h~ppc32-allow-adjust-of-pfn-offset-in-pte	2005-04-12 03:21:11.573377480 -0700
+++ 25-akpm/include/asm-ppc/pgtable.h	2005-04-12 03:21:11.576377024 -0700
@@ -431,10 +431,15 @@ extern unsigned long bad_call_to_PMD_PAG
  * Conversions between PTE values and page frame numbers.
  */
 
-#define pte_pfn(x)		(pte_val(x) >> PAGE_SHIFT)
+/* in some case we want to additionaly adjust where the pfn is in the pte to
+ * allow room for more flags */
+#define PFN_SHIFT_OFFSET	(PAGE_SHIFT)
+
+#define pte_pfn(x)		(pte_val(x) >> PFN_SHIFT_OFFSET)
 #define pte_page(x)		pfn_to_page(pte_pfn(x))
 
-#define pfn_pte(pfn, prot)	__pte(((pte_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pte(pfn, prot)	__pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
+					pgprot_val(prot))
 #define mk_pte(page, prot)	pfn_pte(page_to_pfn(page), prot)
 
 /*
_

                 reply	other threads:[~2005-04-12 20:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200504121031.j3CAVBil005257@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=galak@freescale.com \
    --cc=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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®