diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-10 06:35:53 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:44 -0500 |
commit | 959f7d587e236a2d218f527771f156c336409d11 (patch) | |
tree | 9cbc0ec58d072dc58c04e91488a8013518582af4 /include/asm-sh | |
parent | 256b22ca66987c537064dc25b0b267966189b5ba (diff) |
sh: Move over the SH-5 head.S and tlb.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/tlb.h | 10 | ||||
-rw-r--r-- | include/asm-sh/tlb_64.h | 69 |
2 files changed, 78 insertions, 1 deletions
diff --git a/include/asm-sh/tlb.h b/include/asm-sh/tlb.h index 53d185bcf872..56ad1fb888a2 100644 --- a/include/asm-sh/tlb.h +++ b/include/asm-sh/tlb.h | |||
@@ -1,6 +1,12 @@ | |||
1 | #ifndef __ASM_SH_TLB_H | 1 | #ifndef __ASM_SH_TLB_H |
2 | #define __ASM_SH_TLB_H | 2 | #define __ASM_SH_TLB_H |
3 | 3 | ||
4 | #ifdef CONFIG_SUPERH64 | ||
5 | # include "tlb_64.h" | ||
6 | #endif | ||
7 | |||
8 | #ifndef __ASSEMBLY__ | ||
9 | |||
4 | #define tlb_start_vma(tlb, vma) \ | 10 | #define tlb_start_vma(tlb, vma) \ |
5 | flush_cache_range(vma, vma->vm_start, vma->vm_end) | 11 | flush_cache_range(vma, vma->vm_start, vma->vm_end) |
6 | 12 | ||
@@ -15,4 +21,6 @@ | |||
15 | #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) | 21 | #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) |
16 | 22 | ||
17 | #include <asm-generic/tlb.h> | 23 | #include <asm-generic/tlb.h> |
18 | #endif | 24 | |
25 | #endif /* __ASSEMBLY__ */ | ||
26 | #endif /* __ASM_SH_TLB_H */ | ||
diff --git a/include/asm-sh/tlb_64.h b/include/asm-sh/tlb_64.h new file mode 100644 index 000000000000..0308e05fc57b --- /dev/null +++ b/include/asm-sh/tlb_64.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * include/asm-sh/tlb_64.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Paul Mundt | ||
5 | * | ||
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 | ||
8 | * for more details. | ||
9 | */ | ||
10 | #ifndef __ASM_SH_TLB_64_H | ||
11 | #define __ASM_SH_TLB_64_H | ||
12 | |||
13 | /* ITLB defines */ | ||
14 | #define ITLB_FIXED 0x00000000 /* First fixed ITLB, see head.S */ | ||
15 | #define ITLB_LAST_VAR_UNRESTRICTED 0x000003F0 /* Last ITLB */ | ||
16 | |||
17 | /* DTLB defines */ | ||
18 | #define DTLB_FIXED 0x00800000 /* First fixed DTLB, see head.S */ | ||
19 | #define DTLB_LAST_VAR_UNRESTRICTED 0x008003F0 /* Last DTLB */ | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | /** | ||
24 | * for_each_dtlb_entry | ||
25 | * | ||
26 | * @tlb: TLB entry | ||
27 | * | ||
28 | * Iterate over free (non-wired) DTLB entries | ||
29 | */ | ||
30 | #define for_each_dtlb_entry(tlb) \ | ||
31 | for (tlb = cpu_data->dtlb.first; \ | ||
32 | tlb <= cpu_data->dtlb.last; \ | ||
33 | tlb += cpu_data->dtlb.step) | ||
34 | |||
35 | /** | ||
36 | * for_each_itlb_entry | ||
37 | * | ||
38 | * @tlb: TLB entry | ||
39 | * | ||
40 | * Iterate over free (non-wired) ITLB entries | ||
41 | */ | ||
42 | #define for_each_itlb_entry(tlb) \ | ||
43 | for (tlb = cpu_data->itlb.first; \ | ||
44 | tlb <= cpu_data->itlb.last; \ | ||
45 | tlb += cpu_data->itlb.step) | ||
46 | |||
47 | /** | ||
48 | * __flush_tlb_slot | ||
49 | * | ||
50 | * @slot: Address of TLB slot. | ||
51 | * | ||
52 | * Flushes TLB slot @slot. | ||
53 | */ | ||
54 | static inline void __flush_tlb_slot(unsigned long long slot) | ||
55 | { | ||
56 | __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot)); | ||
57 | } | ||
58 | |||
59 | /* arch/sh64/mm/tlb.c */ | ||
60 | int sh64_tlb_init(void); | ||
61 | unsigned long long sh64_next_free_dtlb_entry(void); | ||
62 | unsigned long long sh64_get_wired_dtlb_entry(void); | ||
63 | int sh64_put_wired_dtlb_entry(unsigned long long entry); | ||
64 | void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr, | ||
65 | unsigned long asid, unsigned long paddr); | ||
66 | void sh64_teardown_tlb_slot(unsigned long long config_addr); | ||
67 | |||
68 | #endif /* __ASSEMBLY__ */ | ||
69 | #endif /* __ASM_SH_TLB_64_H */ | ||