Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2818
b: refs/heads/master
c: bdf0424
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Jun 22, 2005
1 parent 9442aab commit 4cb40af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 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: e00d349e7781a92cf35b242259c9e5341a9661bb
refs/heads/master: bdf042486a01aefaf29d74be1b4526daa70a5f0f
24 changes: 9 additions & 15 deletions trunk/include/asm-arm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ static inline void pte_free(struct page *pte)
__free_page(pte);
}

static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval)
{
pmdp[0] = __pmd(pmdval);
pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
flush_pmd_entry(pmdp);
}

/*
* Populate the pmdp entry with a pointer to the pte. This pmd is part
* of the mm address space.
Expand All @@ -99,32 +106,19 @@ static inline void
pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
{
unsigned long pte_ptr = (unsigned long)ptep;
unsigned long pmdval;

BUG_ON(mm != &init_mm);

/*
* The pmd must be loaded with the physical
* address of the PTE table
*/
pte_ptr -= PTRS_PER_PTE * sizeof(void *);
pmdval = __pa(pte_ptr) | _PAGE_KERNEL_TABLE;
pmdp[0] = __pmd(pmdval);
pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
flush_pmd_entry(pmdp);
__pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE);
}

static inline void
pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)
{
unsigned long pmdval;

BUG_ON(mm == &init_mm);

pmdval = page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE;
pmdp[0] = __pmd(pmdval);
pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
flush_pmd_entry(pmdp);
__pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);
}

#endif

0 comments on commit 4cb40af

Please sign in to comment.