Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87491
b: refs/heads/master
c: 77f6078
h: refs/heads/master
i:
  87489: 51e2bbb
  87487: de8df15
v: v3
  • Loading branch information
Randy Dunlap authored and Linus Torvalds committed Mar 20, 2008
1 parent 93d24b1 commit f6c41a8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 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: 1b578df02207a67a29e8ced4db3b36d89df52fef
refs/heads/master: 77f6078aa8945a18a7780694940e52be0322c2b8
30 changes: 26 additions & 4 deletions trunk/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ static void flush_all_zero_pkmaps(void)
flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
}

/* Flush all unused kmap mappings in order to remove stray
mappings. */
/**
* kmap_flush_unused - flush all unused kmap mappings in order to remove stray mappings
*/
void kmap_flush_unused(void)
{
spin_lock(&kmap_lock);
Expand Down Expand Up @@ -163,15 +164,21 @@ static inline unsigned long map_new_virtual(struct page *page)
return vaddr;
}

/**
* kmap_high - map a highmem page into memory
* @page: &struct page to map
*
* Returns the page's virtual memory address.
*
* We cannot call this from interrupts, as it may block.
*/
void *kmap_high(struct page *page)
{
unsigned long vaddr;

/*
* For highmem pages, we can't trust "virtual" until
* after we have the lock.
*
* We cannot call this from interrupts, as it may block
*/
spin_lock(&kmap_lock);
vaddr = (unsigned long)page_address(page);
Expand All @@ -185,6 +192,10 @@ void *kmap_high(struct page *page)

EXPORT_SYMBOL(kmap_high);

/**
* kunmap_high - map a highmem page into memory
* @page: &struct page to unmap
*/
void kunmap_high(struct page *page)
{
unsigned long vaddr;
Expand Down Expand Up @@ -259,6 +270,12 @@ static struct page_address_slot *page_slot(struct page *page)
return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)];
}

/**
* page_address - get the mapped virtual address of a page
* @page: &struct page to get the virtual address of
*
* Returns the page's virtual address.
*/
void *page_address(struct page *page)
{
unsigned long flags;
Expand Down Expand Up @@ -288,6 +305,11 @@ void *page_address(struct page *page)

EXPORT_SYMBOL(page_address);

/**
* set_page_address - set a page's virtual address
* @page: &struct page to set
* @virtual: virtual address to use
*/
void set_page_address(struct page *page, void *virtual)
{
unsigned long flags;
Expand Down

0 comments on commit f6c41a8

Please sign in to comment.