Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11142
b: refs/heads/master
c: 6008026
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent c0f0270 commit 7770337
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 129bc8f78b468df6824dd1584829f10aa3a69c27
refs/heads/master: 60080265a13ea43f0ebdcd25671dcab05ed01308
19 changes: 19 additions & 0 deletions trunk/arch/mips/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
preempt_check_resched();
}

/*
* This is the same as kmap_atomic() but can map memory that doesn't
* have a struct page associated with it.
*/
void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
{
enum fixed_addresses idx;
unsigned long vaddr;

inc_preempt_count();

idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
flush_tlb_one(vaddr);

return (void*) vaddr;
}

struct page *__kmap_atomic_to_page(void *ptr)
{
unsigned long idx, vaddr = (unsigned long)ptr;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-mips/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
}

static inline void kunmap_atomic(void *kvaddr, enum km_type type) { }
#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))

#define kmap_atomic_to_page(ptr) virt_to_page(ptr)

Expand All @@ -86,6 +87,7 @@ extern void *__kmap(struct page *page);
extern void __kunmap(struct page *page);
extern void *__kmap_atomic(struct page *page, enum km_type type);
extern void __kunmap_atomic(void *kvaddr, enum km_type type);
extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
extern struct page *__kmap_atomic_to_page(void *ptr);

#define kmap __kmap
Expand Down

0 comments on commit 7770337

Please sign in to comment.