4 #ifdef CONFIG_METAG_USER_TCM
5 #include <linux/list.h>
8 #ifdef CONFIG_HUGETLB_PAGE
13 /* Software pgd base pointer used for Meta 1.x MMU. */
14 unsigned long pgd_base;
15 #ifdef CONFIG_METAG_USER_TCM
18 #ifdef CONFIG_HUGETLB_PAGE
19 #if HPAGE_SHIFT < HUGEPT_SHIFT
20 /* last partially filled huge page table address */
21 unsigned long part_huge;
26 /* Given a virtual address, return the pte for the top level 4meg entry
27 * that maps that address.
28 * Returns 0 (an empty pte) if that range is not mapped.
30 unsigned long mmu_read_first_level_page(unsigned long vaddr);
32 /* Given a linear (virtual) address, return the second level 4k pte
33 * that maps that address. Returns 0 if the address is not mapped.
35 unsigned long mmu_read_second_level_page(unsigned long vaddr);
37 /* Get the virtual base address of the MMU */
38 unsigned long mmu_get_base(void);
40 /* Initialize the MMU. */
41 void mmu_init(unsigned long mem_end);
43 #ifdef CONFIG_METAG_META21_MMU
45 * For cpu "cpu" calculate and return the address of the
46 * MMCU_TnLOCAL_TABLE_PHYS0 if running in local-space or
47 * MMCU_TnGLOBAL_TABLE_PHYS0 if running in global-space.
49 static inline unsigned long mmu_phys0_addr(unsigned int cpu)
53 phys0 = (MMCU_T0LOCAL_TABLE_PHYS0 +
54 (MMCU_TnX_TABLE_PHYSX_STRIDE * cpu)) +
55 (MMCU_TXG_TABLE_PHYSX_OFFSET * is_global_space(PAGE_OFFSET));
61 * For cpu "cpu" calculate and return the address of the
62 * MMCU_TnLOCAL_TABLE_PHYS1 if running in local-space or
63 * MMCU_TnGLOBAL_TABLE_PHYS1 if running in global-space.
65 static inline unsigned long mmu_phys1_addr(unsigned int cpu)
69 phys1 = (MMCU_T0LOCAL_TABLE_PHYS1 +
70 (MMCU_TnX_TABLE_PHYSX_STRIDE * cpu)) +
71 (MMCU_TXG_TABLE_PHYSX_OFFSET * is_global_space(PAGE_OFFSET));
75 #endif /* CONFIG_METAG_META21_MMU */