linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 4/8] ARM: idmap: add header file for identity mapping functions
Date: Tue, 23 Aug 2011 22:46:48 +0100	[thread overview]
Message-ID: <1314136012-20533-5-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1314136012-20533-1-git-send-email-will.deacon@arm.com>

The identity mappings functions are useful outside of SMP booting, so
expose them through their own header file.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/include/asm/idmap.h   |   11 +++++++++++
 arch/arm/include/asm/pgtable.h |    3 ---
 arch/arm/kernel/process.c      |    3 +--
 arch/arm/kernel/smp.c          |    1 +
 arch/arm/mm/idmap.c            |    5 +++++
 5 files changed, 18 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/include/asm/idmap.h

diff --git a/arch/arm/include/asm/idmap.h b/arch/arm/include/asm/idmap.h
new file mode 100644
index 0000000..fe7ea86
--- /dev/null
+++ b/arch/arm/include/asm/idmap.h
@@ -0,0 +1,11 @@
+#ifndef _ARM_IDMAP_H
+#define _ARM_IDMAP_H
+
+#include <asm/page.h>
+
+void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end);
+void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end);
+
+void setup_mm_for_reboot(char mode);
+
+#endif	/* _ARM_IDMAP_H */
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 5750704..9d559a8 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -474,9 +474,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 #define pgtable_cache_init() do { } while (0)
 
-void identity_mapping_add(pgd_t *, unsigned long, unsigned long);
-void identity_mapping_del(pgd_t *, unsigned long, unsigned long);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* CONFIG_MMU */
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 1a347f4..89fe6ee 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -33,6 +33,7 @@
 #include <linux/cpuidle.h>
 
 #include <asm/cacheflush.h>
+#include <asm/idmap.h>
 #include <asm/leds.h>
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -57,8 +58,6 @@ static const char *isa_modes[] = {
   "ARM" , "Thumb" , "Jazelle", "ThumbEE"
 };
 
-extern void setup_mm_for_reboot(char mode);
-
 static volatile int hlt_counter;
 
 #include <mach/system.h>
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index d88ff02..96a7956 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -39,6 +39,7 @@
 #include <asm/tlbflush.h>
 #include <asm/ptrace.h>
 #include <asm/localtimer.h>
+#include <asm/idmap.h>
 
 /*
  * as from 2.5, kernels no longer have an init_tasks structure
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 2be9139..e99dc38 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -1,6 +1,7 @@
 #include <linux/kernel.h>
 
 #include <asm/cputype.h>
+#include <asm/idmap.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 
@@ -71,6 +72,10 @@ void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
 		idmap_del_pud(pgd, addr, next);
 	} while (pgd++, addr = next, addr != end);
 }
+#else
+void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
+{
+}
 #endif
 
 /*
-- 
1.7.0.4

  parent reply	other threads:[~2011-08-23 21:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 21:46 [PATCH v4 0/8] MMU disabling code and kexec fixes Will Deacon
2011-08-23 21:46 ` [PATCH v4 1/8] ARM: proc-v7: disable SCTLR.TE when disabling MMU Will Deacon
2011-08-24 10:15   ` Dave Martin
2011-08-24 11:01     ` Will Deacon
2011-08-25 11:19       ` Dave Martin
2011-08-23 21:46 ` [PATCH v4 2/8] ARM: kexec: ensure new kernel is entered in ARM state Will Deacon
2011-08-24  1:28   ` Nicolas Pitre
2011-08-24 10:17     ` Dave Martin
2011-08-24 11:13     ` Will Deacon
2011-08-24 10:16   ` Dave Martin
2011-08-23 21:46 ` [PATCH v4 3/8] ARM: lib: add switch_stack function for safely changing stack Will Deacon
2011-08-24  1:07   ` Nicolas Pitre
2011-08-24 10:19     ` Dave Martin
2011-08-24 11:14     ` Will Deacon
2011-08-23 21:46 ` Will Deacon [this message]
2011-08-23 21:46 ` [PATCH v4 5/8] ARM: reset: allow kernelspace mappings to be flat mapped during reset Will Deacon
2011-08-23 21:46 ` [PATCH v4 6/8] ARM: reset: add reset functionality for jumping to a physical address Will Deacon
2011-08-23 21:46 ` [PATCH v4 7/8] ARM: kexec: use arm_machine_reset for branching to the reboot buffer Will Deacon
2011-08-23 21:46 ` [PATCH v4 8/8] ARM: stop: execute platform callback from cpu_stop code Will Deacon
2011-08-24  1:25 ` [PATCH v4 0/8] MMU disabling code and kexec fixes Nicolas Pitre
2011-08-24 10:58   ` Will Deacon
2011-08-24 14:53     ` Nicolas Pitre
2011-08-24 16:59       ` Will Deacon
2011-08-24 17:30         ` Nicolas Pitre
2011-08-24 17:45           ` Will Deacon
2011-08-25 13:16             ` Will Deacon
2011-08-24 12:34 ` Jamie Iles
2011-08-24 12:42   ` Will Deacon
2011-08-24 12:54     ` Jamie Iles

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=1314136012-20533-5-git-send-email-will.deacon@arm.com \
    --to=will.deacon@arm.com \
    --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).