aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi DOYU <Hiroshi.DOYU@nokia.com>2010-05-13 02:45:35 -0400
committerHiroshi DOYU <Hiroshi.DOYU@nokia.com>2010-06-29 00:55:04 -0400
commita1a54456d08ff8d406b550b60f97088ac7401b8c (patch)
tree7b0e4b61672507fa0634fd8e722c34caefb53b97
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
omap iommu: Introduce iopgd_is_table MACRO
A bit more strict comparison. Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
-rw-r--r--arch/arm/plat-omap/iommu.c8
-rw-r--r--arch/arm/plat-omap/iopgtable.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index bc094dbacee6..341c48179ee0 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -653,7 +653,7 @@ void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte)
653 if (!*iopgd) 653 if (!*iopgd)
654 goto out; 654 goto out;
655 655
656 if (*iopgd & IOPGD_TABLE) 656 if (iopgd_is_table(*iopgd))
657 iopte = iopte_offset(iopgd, da); 657 iopte = iopte_offset(iopgd, da);
658out: 658out:
659 *ppgd = iopgd; 659 *ppgd = iopgd;
@@ -670,7 +670,7 @@ static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da)
670 if (!*iopgd) 670 if (!*iopgd)
671 return 0; 671 return 0;
672 672
673 if (*iopgd & IOPGD_TABLE) { 673 if (iopgd_is_table(*iopgd)) {
674 int i; 674 int i;
675 u32 *iopte = iopte_offset(iopgd, da); 675 u32 *iopte = iopte_offset(iopgd, da);
676 676
@@ -745,7 +745,7 @@ static void iopgtable_clear_entry_all(struct iommu *obj)
745 if (!*iopgd) 745 if (!*iopgd)
746 continue; 746 continue;
747 747
748 if (*iopgd & IOPGD_TABLE) 748 if (iopgd_is_table(*iopgd))
749 iopte_free(iopte_offset(iopgd, 0)); 749 iopte_free(iopte_offset(iopgd, 0));
750 750
751 *iopgd = 0; 751 *iopgd = 0;
@@ -785,7 +785,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
785 785
786 iopgd = iopgd_offset(obj, da); 786 iopgd = iopgd_offset(obj, da);
787 787
788 if (!(*iopgd & IOPGD_TABLE)) { 788 if (!iopgd_is_table(*iopgd)) {
789 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, 789 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__,
790 da, iopgd, *iopgd); 790 da, iopgd, *iopgd);
791 return IRQ_NONE; 791 return IRQ_NONE;
diff --git a/arch/arm/plat-omap/iopgtable.h b/arch/arm/plat-omap/iopgtable.h
index ab23b6a140fd..f2e6b64cca64 100644
--- a/arch/arm/plat-omap/iopgtable.h
+++ b/arch/arm/plat-omap/iopgtable.h
@@ -63,6 +63,8 @@
63#define IOPGD_SECTION (2 << 0) 63#define IOPGD_SECTION (2 << 0)
64#define IOPGD_SUPER (1 << 18 | 2 << 0) 64#define IOPGD_SUPER (1 << 18 | 2 << 0)
65 65
66#define iopgd_is_table(x) (((x) & 3) == IOPGD_TABLE)
67
66#define IOPTE_SMALL (2 << 0) 68#define IOPTE_SMALL (2 << 0)
67#define IOPTE_LARGE (1 << 0) 69#define IOPTE_LARGE (1 << 0)
68 70