linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm: fixmap: implement __set_fixmap()
Date: Fri,  4 Apr 2014 23:27:49 +0200	[thread overview]
Message-ID: <1396646870-29695-1-git-send-email-rabin@rab.in> (raw)

This is used from set_fixmap() and clear_fixmap() via
asm-generic/fixmap.h.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
Needs "arm: use generic fixmap.h", available in linux-next.

 arch/arm/include/asm/fixmap.h | 2 ++
 arch/arm/mm/mmu.c             | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h
index 68ea615..55ed076 100644
--- a/arch/arm/include/asm/fixmap.h
+++ b/arch/arm/include/asm/fixmap.h
@@ -23,6 +23,8 @@ enum fixed_addresses {
 	__end_of_fixed_addresses
 };
 
+void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot);
+
 #include <asm-generic/fixmap.h>
 
 #endif
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 3e16307..61bdfb1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -22,6 +22,7 @@
 #include <asm/cputype.h>
 #include <asm/sections.h>
 #include <asm/cachetype.h>
+#include <asm/fixmap.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/smp_plat.h>
@@ -388,6 +389,12 @@ SET_MEMORY_FN(rw, pte_set_rw)
 SET_MEMORY_FN(x, pte_set_x)
 SET_MEMORY_FN(nx, pte_set_nx)
 
+void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
+{
+	BUG_ON(idx >= __end_of_fixed_addresses);
+	set_top_pte(__fix_to_virt(idx), pfn_pte(__phys_to_pfn(phys), prot));
+}
+
 /*
  * Adjust the PMD section entries according to the CPU in use.
  */
-- 
1.9.1

             reply	other threads:[~2014-04-04 21:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 21:27 Rabin Vincent [this message]
2014-04-04 21:27 ` [PATCH 2/2] arm: use fixmap for text patching when text is RO Rabin Vincent
2014-04-07 13:57   ` Jon Medhurst (Tixy)
2014-04-07 18:04     ` Kees Cook
2014-04-08  9:31       ` Jon Medhurst (Tixy)
2014-04-10 19:34     ` Rabin Vincent
2014-04-23 21:09   ` Kees Cook
2014-04-23 22:51     ` Doug Anderson
2014-04-24 21:28   ` [PATCHv2 " Rabin Vincent
2014-04-25  0:52 ` [PATCH 1/2] arm: fixmap: implement __set_fixmap() Doug Anderson

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=1396646870-29695-1-git-send-email-rabin@rab.in \
    --to=rabin@rab.in \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).