5 * linux/include/asm-arm26/proc-armv/rmap.h
7 * Architecture dependant parts of the reverse mapping code,
9 * ARM is different since hardware page tables are smaller than
10 * the page size and Linux uses a "duplicate" one with extra info.
11 * For rmap this means that the first 2 kB of a page are the hardware
12 * page tables and the last 2 kB are the software page tables.
15 static inline void pgtable_add_rmap(struct page *page, struct mm_struct * mm, unsigned long address)
17 page->mapping = (void *)mm;
18 page->index = address & ~((PTRS_PER_PTE * PAGE_SIZE) - 1);
19 inc_page_state(nr_page_table_pages);
22 static inline void pgtable_remove_rmap(struct page *page)
26 dec_page_state(nr_page_table_pages);
29 static inline struct mm_struct * ptep_to_mm(pte_t * ptep)
31 struct page * page = virt_to_page(ptep);
32 return (struct mm_struct *)page->mapping;
35 /* The page table takes half of the page */
36 #define PTE_MASK ((PAGE_SIZE / 2) - 1)
38 static inline unsigned long ptep_to_address(pte_t * ptep)
40 struct page * page = virt_to_page(ptep);
41 unsigned long low_bits;
43 low_bits = ((unsigned long)ptep & PTE_MASK) * PTRS_PER_PTE;
44 return page->index + low_bits;
47 //FIXME!!! IS these correct?
48 static inline pte_addr_t ptep_to_paddr(pte_t *ptep)
50 return (pte_addr_t)ptep;
53 static inline pte_t *rmap_ptep_map(pte_addr_t pte_paddr)
55 return (pte_t *)pte_paddr;
58 static inline void rmap_ptep_unmap(pte_t *pte)
64 //#include <asm-generic/rmap.h>
66 #endif /* _ARM_RMAP_H */