Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 1.30 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Some questions in v6_copy_user_highpage_aliasing
  2. 72 /*
  3.  73  * Copy the page, taking account of the cache colour.
  4.  74  */
  5.  75 static void v6_copy_user_highpage_aliasing(struct page *to,
  6.  76         struct page *from, unsigned long vaddr)
  7.  77 {
  8.  78         unsigned int offset = CACHE_COLOUR(vaddr);
  9.  79         unsigned long kfrom, kto;
  10.  80
  11.        
  12. 81         if (test_and_clear_bit(PG_dcache_dirty, &from->flags))
  13.  82                 __flush_dcache_page(page_mapping(from), from);
  14.  83
  15.        
  16. 84         /* FIXME: not highmem safe */
  17.   85         discard_old_kernel_data(page_address(to));
  18.   86
  19.   87         /*
  20.   88          * Now copy the page using the same cache colour as the
  21.   89          * pages ultimate destination.
  22.   90          */
  23.   91         spin_lock(&v6_lock);
  24.   92
  25.   93         set_pte_ext(TOP_PTE(from_address) + offset,
  26.                      pfn_pte(page_to_pfn(from), PAGE_KERNEL), 0);
  27.   94         set_pte_ext(TOP_PTE(to_address) + offset,
  28.                      pfn_pte(page_to_pfn(to), PAGE_KERNEL), 0);
  29.   95
  30.   96         kfrom = from_address + (offset << PAGE_SHIFT);
  31.   97         kto   = to_address + (offset << PAGE_SHIFT);
  32.   98
  33.   99         flush_tlb_kernel_page(kfrom);
  34.  100         flush_tlb_kernel_page(kto);
  35.  101
  36.  102         copy_page((void *)kto, (void *)kfrom);
  37.  103
  38.  104         spin_unlock(&v6_lock);
  39.  105 }