Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225907
b: refs/heads/master
c: 6e4beb5
h: refs/heads/master
i:
  225905: 79acc47
  225903: 4faeba9
v: v3
  • Loading branch information
Russell King committed Nov 26, 2010
1 parent d2a66a2 commit 8497af0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0d03745b18c39b8e86e70f7778f2093d2cd4ed7
refs/heads/master: 6e4beb5e682953212da48ebb9e5c90408b8d38ae
27 changes: 14 additions & 13 deletions trunk/arch/arm/mm/pgd.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,29 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
return NULL;
}

void pgd_free(struct mm_struct *mm, pgd_t *pgd)
void pgd_free(struct mm_struct *mm, pgd_t *pgd_base)
{
pgd_t *pgd;
pmd_t *pmd;
pgtable_t pte;

if (!pgd)
if (!pgd_base)
return;

/* pgd is always present and good */
pmd = pmd_off(pgd, 0);
if (pmd_none(*pmd))
goto free;
if (pmd_bad(*pmd)) {
pmd_ERROR(*pmd);
pmd_clear(pmd);
goto free;
}
pgd = pgd_base + pgd_index(0);
if (pgd_none_or_clear_bad(pgd))
goto no_pgd;

pmd = pmd_offset(pgd, 0);
if (pmd_none_or_clear_bad(pmd))
goto no_pmd;

pte = pmd_pgtable(*pmd);
pmd_clear(pmd);
pte_free(mm, pte);
no_pmd:
pgd_clear(pgd);
pmd_free(mm, pmd);
free:
free_pages((unsigned long) pgd, 2);
no_pgd:
free_pages((unsigned long) pgd_base, 2);
}

0 comments on commit 8497af0

Please sign in to comment.