2 * include/asm-sh64/tlb.h
4 * Copyright (C) 2003 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
11 #ifndef __ASM_SH64_TLB_H
12 #define __ASM_SH64_TLB_H
15 * Note! These are mostly unused, we just need the xTLB_LAST_VAR_UNRESTRICTED
16 * for head.S! Once this limitation is gone, we can clean the rest of this up.
20 #define ITLB_FIXED 0x00000000 /* First fixed ITLB, see head.S */
21 #define ITLB_LAST_VAR_UNRESTRICTED 0x000003F0 /* Last ITLB */
24 #define DTLB_FIXED 0x00800000 /* First fixed DTLB, see head.S */
25 #define DTLB_LAST_VAR_UNRESTRICTED 0x008003F0 /* Last DTLB */
29 #include <asm-generic/tlb.h>
32 * TLB information structure
34 * Defined for both I and D tlb, per-processor.
37 unsigned long long next;
38 unsigned long long first;
39 unsigned long long last;
52 * Iterate over free (non-wired) DTLB entries
54 #define for_each_dtlb_entry(tlb) \
55 for (tlb = cpu_data->dtlb.first; \
56 tlb <= cpu_data->dtlb.last; \
57 tlb += cpu_data->dtlb.step)
64 * Iterate over free (non-wired) ITLB entries
66 #define for_each_itlb_entry(tlb) \
67 for (tlb = cpu_data->itlb.first; \
68 tlb <= cpu_data->itlb.last; \
69 tlb += cpu_data->itlb.step)
74 * @slot: Address of TLB slot.
76 * Flushes TLB slot @slot.
78 static inline void __flush_tlb_slot(unsigned long long slot)
80 __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
83 /* arch/sh64/mm/tlb.c */
84 extern int sh64_tlb_init(void);
85 extern unsigned long long sh64_next_free_dtlb_entry(void);
86 extern unsigned long long sh64_get_wired_dtlb_entry(void);
87 extern int sh64_put_wired_dtlb_entry(unsigned long long entry);
89 extern void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr, unsigned long asid, unsigned long paddr);
90 extern void sh64_teardown_tlb_slot(unsigned long long config_addr);
92 #endif /* __ASSEMBLY__ */
94 #endif /* __ASM_SH64_TLB_H */