Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297573
b: refs/heads/master
c: 0d31fe4
h: refs/heads/master
i:
  297571: 2c79c3d
v: v3
  • Loading branch information
Russell King committed Jan 26, 2012
1 parent 40e401e commit cd89a57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 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: 67ece1443174d852e71c42facb3e2d7dd338c88a
refs/heads/master: 0d31fe47b0f62e6546779eae2fc9b2e024aff4ce
8 changes: 3 additions & 5 deletions trunk/arch/arm/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void *__kmap_atomic(struct page *page)
* With debugging enabled, kunmap_atomic forces that entry to 0.
* Make sure it was indeed properly unmapped.
*/
BUG_ON(!pte_none(*(TOP_PTE(vaddr))));
BUG_ON(!pte_none(get_top_pte(vaddr)));
#endif
/*
* When debugging is off, kunmap_atomic leaves the previous mapping
Expand Down Expand Up @@ -119,7 +119,7 @@ void *kmap_atomic_pfn(unsigned long pfn)
idx = type + KM_TYPE_NR * smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
#ifdef CONFIG_DEBUG_HIGHMEM
BUG_ON(!pte_none(*(TOP_PTE(vaddr))));
BUG_ON(!pte_none(get_top_pte(vaddr)));
#endif
set_top_pte(vaddr, pfn_pte(pfn, kmap_prot));

Expand All @@ -129,11 +129,9 @@ void *kmap_atomic_pfn(unsigned long pfn)
struct page *kmap_atomic_to_page(const void *ptr)
{
unsigned long vaddr = (unsigned long)ptr;
pte_t *pte;

if (vaddr < FIXADDR_START)
return virt_to_page(ptr);

pte = TOP_PTE(vaddr);
return pte_page(*pte);
return pte_page(get_top_pte(vaddr));
}
5 changes: 5 additions & 0 deletions trunk/arch/arm/mm/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ static inline void set_top_pte(unsigned long va, pte_t pte)
local_flush_tlb_kernel_page(va);
}

static inline pte_t get_top_pte(unsigned long va)
{
return *TOP_PTE(va);
}

static inline pmd_t *pmd_off_k(unsigned long virt)
{
return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
Expand Down

0 comments on commit cd89a57

Please sign in to comment.