linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radosław Smogura" <mail@smogura.eu>
To: linux-mm@kvack.org
Cc: Yongqiang Yang <xiaoqiangnk@gmail.com>,
	mail@smogura.eu, linux-ext4@vger.kernel.org
Subject: [PATCH 12/18] Additional macros for pmd operations
Date: Thu, 16 Feb 2012 15:31:39 +0100	[thread overview]
Message-ID: <1329402705-25454-12-git-send-email-mail@smogura.eu> (raw)
In-Reply-To: <1329402705-25454-1-git-send-email-mail@smogura.eu>

Macros for operating on pmd in simillar way like for pte.

Signed-off-by: Radosław Smogura <mail@smogura.eu>
---
 arch/x86/include/asm/pgtable.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 49afb3f..38fd008 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -265,6 +265,11 @@ static inline pmd_t pmd_wrprotect(pmd_t pmd)
 	return pmd_clear_flags(pmd, _PAGE_RW);
 }
 
+static inline int pmd_dirty(pmd_t pmd)
+{
+	return pmd_flags(pmd) & _PAGE_DIRTY;
+}
+
 static inline pmd_t pmd_mkdirty(pmd_t pmd)
 {
 	return pmd_set_flags(pmd, _PAGE_DIRTY);
@@ -285,6 +290,11 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd)
 	return pmd_set_flags(pmd, _PAGE_RW);
 }
 
+static inline pmd_t pmd_writeprotect(pmd_t pmd)
+{
+	return pmd_clear_flags(pmd, _PAGE_RW);
+}
+
 static inline pmd_t pmd_mknotpresent(pmd_t pmd)
 {
 	return pmd_clear_flags(pmd, _PAGE_PRESENT);
@@ -731,6 +741,17 @@ static inline int pmd_write(pmd_t pmd)
 	return pmd_flags(pmd) & _PAGE_RW;
 }
 
+#define __HAVE_ARCH_PMD_EXEC
+static inline int pmd_exec(pmd_t pmd)
+{
+	return !(pmd_flags(pmd) & _PAGE_NX);
+}
+
+static inline void pmd_mkexec(pmd_t pmd)
+{
+	pmd_clear_flags(pmd, _PAGE_NX);
+}
+
 #define __HAVE_ARCH_PMDP_GET_AND_CLEAR
 static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, unsigned long addr,
 				       pmd_t *pmdp)
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-02-16 21:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 14:31 [PATCH 01/18] Added hacking menu for override optimization by GCC Radosław Smogura
2012-02-16 14:31 ` [PATCH 02/18] Change of refcounting method for compound pages and atomic heads Radosław Smogura
2012-02-16 14:31 ` [PATCH 03/18] Compound read / write locking aka get / put Radosław Smogura
2012-02-16 14:31 ` [PATCH 04/18] Page flag for tracking compound deque Radosław Smogura
2012-02-16 14:31 ` [PATCH 05/18] Various VM_BUG_ON for securing tail pages usage Radosław Smogura
2012-02-16 14:31 ` [PATCH 06/18] Make migrate pages fucntion more flexible Radosław Smogura
2012-02-16 14:31 ` [PATCH 07/18] Configuration menu for Huge Page Cache Radosław Smogura
2012-02-16 14:31 ` [PATCH 08/18] Generic routines for defragmenting pagecache Radosław Smogura
2012-02-16 14:31 ` [PATCH 09/18] Allowing usage of MAP_HUGETLB in mmap Radosław Smogura
2012-02-16 14:31 ` [PATCH 10/18] Support for huge page faulting Radosław Smogura
2012-02-16 14:31 ` [PATCH 11/18] Basic support (faulting) for huge pages for shmfs Radosław Smogura
2012-02-16 14:31 ` Radosław Smogura [this message]
2012-02-16 14:31 ` [PATCH 13/18] Zapping and freeing huge mappings Radosław Smogura
2012-02-16 14:31 ` [PATCH 14/18] Fixes for proc memory Radosław Smogura
2012-02-16 14:31 ` [PATCH 15/18] Splitting and truncating Radosław Smogura
2012-02-16 14:31 ` [PATCH 16/18] SHM: Support for splitting on truncation Radosław Smogura
2012-02-16 14:31 ` [PATCH 17/18] [Experimental] Support for huge pages in EXT 4 Radosław Smogura
2012-02-16 14:31 ` [PATCH 18/18] [WIP] Dummy patch for details Radosław Smogura
2012-02-16 15:44 ` [PATCH 01/18] Added hacking menu for override optimization by GCC Randy Dunlap
2012-02-16 16:11   ` Radosław Smogura
2012-02-16 19:09 ` Michal Nazarewicz
2012-02-16 20:26   ` Radosław Smogura
2012-02-16 21:59     ` Michal Nazarewicz
2012-02-16 22:40       ` Radosław Smogura
2012-02-16 23:11         ` Michal Nazarewicz
2012-02-17 14:33           ` [PATCH] " Radosław Smogura

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=1329402705-25454-12-git-send-email-mail@smogura.eu \
    --to=mail@smogura.eu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=xiaoqiangnk@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).