
Untitled
By: a guest on
Jul 15th, 2012 | syntax:
None | size: 1.30 KB | hits: 11 | expires: Never
Some questions in v6_copy_user_highpage_aliasing
72 /*
73 * Copy the page, taking account of the cache colour.
74 */
75 static void v6_copy_user_highpage_aliasing(struct page *to,
76 struct page *from, unsigned long vaddr)
77 {
78 unsigned int offset = CACHE_COLOUR(vaddr);
79 unsigned long kfrom, kto;
80
81 if (test_and_clear_bit(PG_dcache_dirty, &from->flags))
82 __flush_dcache_page(page_mapping(from), from);
83
84 /* FIXME: not highmem safe */
85 discard_old_kernel_data(page_address(to));
86
87 /*
88 * Now copy the page using the same cache colour as the
89 * pages ultimate destination.
90 */
91 spin_lock(&v6_lock);
92
93 set_pte_ext(TOP_PTE(from_address) + offset,
pfn_pte(page_to_pfn(from), PAGE_KERNEL), 0);
94 set_pte_ext(TOP_PTE(to_address) + offset,
pfn_pte(page_to_pfn(to), PAGE_KERNEL), 0);
95
96 kfrom = from_address + (offset << PAGE_SHIFT);
97 kto = to_address + (offset << PAGE_SHIFT);
98
99 flush_tlb_kernel_page(kfrom);
100 flush_tlb_kernel_page(kto);
101
102 copy_page((void *)kto, (void *)kfrom);
103
104 spin_unlock(&v6_lock);
105 }