mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-16 19:45:07 +00:00
omap iommu: Introduce iopgd_is_table MACRO
A bit more strict comparison. Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
This commit is contained in:
parent
7e27d6e778
commit
a1a54456d0
2 changed files with 6 additions and 4 deletions
|
@ -653,7 +653,7 @@ void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte)
|
||||||
if (!*iopgd)
|
if (!*iopgd)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (*iopgd & IOPGD_TABLE)
|
if (iopgd_is_table(*iopgd))
|
||||||
iopte = iopte_offset(iopgd, da);
|
iopte = iopte_offset(iopgd, da);
|
||||||
out:
|
out:
|
||||||
*ppgd = iopgd;
|
*ppgd = iopgd;
|
||||||
|
@ -670,7 +670,7 @@ static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da)
|
||||||
if (!*iopgd)
|
if (!*iopgd)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (*iopgd & IOPGD_TABLE) {
|
if (iopgd_is_table(*iopgd)) {
|
||||||
int i;
|
int i;
|
||||||
u32 *iopte = iopte_offset(iopgd, da);
|
u32 *iopte = iopte_offset(iopgd, da);
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ static void iopgtable_clear_entry_all(struct iommu *obj)
|
||||||
if (!*iopgd)
|
if (!*iopgd)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (*iopgd & IOPGD_TABLE)
|
if (iopgd_is_table(*iopgd))
|
||||||
iopte_free(iopte_offset(iopgd, 0));
|
iopte_free(iopte_offset(iopgd, 0));
|
||||||
|
|
||||||
*iopgd = 0;
|
*iopgd = 0;
|
||||||
|
@ -785,7 +785,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
|
||||||
|
|
||||||
iopgd = iopgd_offset(obj, da);
|
iopgd = iopgd_offset(obj, da);
|
||||||
|
|
||||||
if (!(*iopgd & IOPGD_TABLE)) {
|
if (!iopgd_is_table(*iopgd)) {
|
||||||
dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__,
|
dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__,
|
||||||
da, iopgd, *iopgd);
|
da, iopgd, *iopgd);
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
#define IOPGD_SECTION (2 << 0)
|
#define IOPGD_SECTION (2 << 0)
|
||||||
#define IOPGD_SUPER (1 << 18 | 2 << 0)
|
#define IOPGD_SUPER (1 << 18 | 2 << 0)
|
||||||
|
|
||||||
|
#define iopgd_is_table(x) (((x) & 3) == IOPGD_TABLE)
|
||||||
|
|
||||||
#define IOPTE_SMALL (2 << 0)
|
#define IOPTE_SMALL (2 << 0)
|
||||||
#define IOPTE_LARGE (1 << 0)
|
#define IOPTE_LARGE (1 << 0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue