diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-11-15 19:16:01 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-11-26 15:45:46 -0500 |
commit | 97092e0c56830457af0639f6bd904537a150ea4a (patch) | |
tree | 5452905cff4e52465329a10de6ab8add2bd1de5a | |
parent | 6e4beb5e682953212da48ebb9e5c90408b8d38ae (diff) |
ARM: pgtable: use phys_addr_t for physical addresses
Ensure that physical addresses are typed as phys_addr_t
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/include/asm/pgalloc.h | 8 | ||||
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 2 | ||||
-rw-r--r-- | arch/arm/mm/mmu.c | 7 |
3 files changed, 10 insertions, 7 deletions
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index e9c39352cee1..1f1064b519c0 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h | |||
@@ -103,8 +103,10 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | |||
103 | __free_page(pte); | 103 | __free_page(pte); |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval) | 106 | static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, |
107 | unsigned long prot) | ||
107 | { | 108 | { |
109 | unsigned long pmdval = pte | prot; | ||
108 | pmdp[0] = __pmd(pmdval); | 110 | pmdp[0] = __pmd(pmdval); |
109 | pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); | 111 | pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); |
110 | flush_pmd_entry(pmdp); | 112 | flush_pmd_entry(pmdp); |
@@ -126,13 +128,13 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) | |||
126 | * address of the PTE table | 128 | * address of the PTE table |
127 | */ | 129 | */ |
128 | pte_ptr -= PTRS_PER_PTE * sizeof(void *); | 130 | pte_ptr -= PTRS_PER_PTE * sizeof(void *); |
129 | __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE); | 131 | __pmd_populate(pmdp, __pa(pte_ptr), _PAGE_KERNEL_TABLE); |
130 | } | 132 | } |
131 | 133 | ||
132 | static inline void | 134 | static inline void |
133 | pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) | 135 | pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) |
134 | { | 136 | { |
135 | __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); | 137 | __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE); |
136 | } | 138 | } |
137 | #define pmd_pgtable(pmd) pmd_page(pmd) | 139 | #define pmd_pgtable(pmd) pmd_page(pmd) |
138 | 140 | ||
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index d00ef7ecee64..30b3a07dd998 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -322,7 +322,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
322 | 322 | ||
323 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) | 323 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) |
324 | { | 324 | { |
325 | unsigned long ptr; | 325 | phys_addr_t ptr; |
326 | 326 | ||
327 | ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1); | 327 | ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1); |
328 | ptr += PTRS_PER_PTE * sizeof(void *); | 328 | ptr += PTRS_PER_PTE * sizeof(void *); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 72ad3e1f56cf..9568f8632ae3 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -535,7 +535,7 @@ static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned l | |||
535 | { | 535 | { |
536 | if (pmd_none(*pmd)) { | 536 | if (pmd_none(*pmd)) { |
537 | pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t)); | 537 | pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t)); |
538 | __pmd_populate(pmd, __pa(pte) | prot); | 538 | __pmd_populate(pmd, __pa(pte), prot); |
539 | } | 539 | } |
540 | BUG_ON(pmd_bad(*pmd)); | 540 | BUG_ON(pmd_bad(*pmd)); |
541 | return pte_offset_kernel(pmd, addr); | 541 | return pte_offset_kernel(pmd, addr); |
@@ -553,7 +553,7 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | |||
553 | } | 553 | } |
554 | 554 | ||
555 | static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | 555 | static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, |
556 | unsigned long end, unsigned long phys, | 556 | unsigned long end, phys_addr_t phys, |
557 | const struct mem_type *type) | 557 | const struct mem_type *type) |
558 | { | 558 | { |
559 | pmd_t *pmd = pmd_offset(pgd, addr); | 559 | pmd_t *pmd = pmd_offset(pgd, addr); |
@@ -588,7 +588,8 @@ static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | |||
588 | static void __init create_36bit_mapping(struct map_desc *md, | 588 | static void __init create_36bit_mapping(struct map_desc *md, |
589 | const struct mem_type *type) | 589 | const struct mem_type *type) |
590 | { | 590 | { |
591 | unsigned long phys, addr, length, end; | 591 | unsigned long addr, length, end; |
592 | phys_addr_t phys; | ||
592 | pgd_t *pgd; | 593 | pgd_t *pgd; |
593 | 594 | ||
594 | addr = md->virtual; | 595 | addr = md->virtual; |