From mboxrd@z Thu Jan 1 00:00:00 1970 From: frank.hofmann@tomtom.com (Frank Hofmann) Date: Fri, 10 Jun 2011 10:13:18 +0100 (BST) Subject: [PATCH v2 05/10] ARM: idmap: add header file for identity mapping functions In-Reply-To: <1307635142-11312-6-git-send-email-will.deacon@arm.com> References: <1307635142-11312-1-git-send-email-will.deacon@arm.com> <1307635142-11312-6-git-send-email-will.deacon@arm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Will, I'm wondering why identity_mapping_del() is restricted to SMP. Yes have seen that the only current _user_ is SMP initialization, but does that mean it has to be restricted to that ? I'd want to use it in hibernation resume code, to "cleanse" swapper_pg_dir of the identity mappings _after_ resume. That task doesn't depend on SMP or not. Thanks, FrankH. On Thu, 9 Jun 2011, Will Deacon wrote: > The identity mappings functions are useful outside of SMP booting, so > expose them through their own header file. > > Signed-off-by: Will Deacon > --- > arch/arm/include/asm/idmap.h | 16 ++++++++++++++++ > arch/arm/include/asm/pgtable.h | 3 --- > arch/arm/kernel/process.c | 3 +-- > arch/arm/kernel/smp.c | 1 + > arch/arm/mm/idmap.c | 1 + > 5 files changed, 19 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..ea9517e > --- /dev/null > +++ b/arch/arm/include/asm/idmap.h > @@ -0,0 +1,16 @@ > +#ifndef _ARM_IDMAP_H > +#define _ARM_IDMAP_H > + > +#include > + > +void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end); > + > +#ifdef CONFIG_SMP > +void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end); > +#else > +void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end) {}; > +#endif > + > +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 5e1e541..8bd9d94 100644 > --- a/arch/arm/kernel/process.c > +++ b/arch/arm/kernel/process.c > @@ -32,6 +32,7 @@ > #include > > #include > +#include > #include > #include > #include > @@ -56,8 +57,6 @@ static const char *isa_modes[] = { > "ARM" , "Thumb" , "Jazelle", "ThumbEE" > }; > > -extern void setup_mm_for_reboot(char mode); > - > static volatile int hlt_counter; > > #include > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > index 344e52b..dfc76aa 100644 > --- a/arch/arm/kernel/smp.c > +++ b/arch/arm/kernel/smp.c > @@ -39,6 +39,7 @@ > #include > #include > #include > +#include > > /* > * 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..4ae0f09 100644 > --- a/arch/arm/mm/idmap.c > +++ b/arch/arm/mm/idmap.c > @@ -1,6 +1,7 @@ > #include > > #include > +#include > #include > #include > > -- > 1.7.0.4 > >