diff options
Diffstat (limited to 'include/asm-sparc64/mmu.h')
-rw-r--r-- | include/asm-sparc64/mmu.h | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/include/asm-sparc64/mmu.h b/include/asm-sparc64/mmu.h index 8627eed6e83d..230ba678d3b0 100644 --- a/include/asm-sparc64/mmu.h +++ b/include/asm-sparc64/mmu.h | |||
@@ -4,20 +4,9 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/page.h> | 5 | #include <asm/page.h> |
6 | #include <asm/const.h> | 6 | #include <asm/const.h> |
7 | #include <asm/hypervisor.h> | ||
7 | 8 | ||
8 | /* | 9 | #define CTX_NR_BITS 13 |
9 | * For the 8k pagesize kernel, use only 10 hw context bits to optimize some | ||
10 | * shifts in the fast tlbmiss handlers, instead of all 13 bits (specifically | ||
11 | * for vpte offset calculation). For other pagesizes, this optimization in | ||
12 | * the tlbhandlers can not be done; but still, all 13 bits can not be used | ||
13 | * because the tlb handlers use "andcc" instruction which sign extends 13 | ||
14 | * bit arguments. | ||
15 | */ | ||
16 | #if PAGE_SHIFT == 13 | ||
17 | #define CTX_NR_BITS 10 | ||
18 | #else | ||
19 | #define CTX_NR_BITS 12 | ||
20 | #endif | ||
21 | 10 | ||
22 | #define TAG_CONTEXT_BITS ((_AC(1,UL) << CTX_NR_BITS) - _AC(1,UL)) | 11 | #define TAG_CONTEXT_BITS ((_AC(1,UL) << CTX_NR_BITS) - _AC(1,UL)) |
23 | 12 | ||
@@ -90,8 +79,27 @@ | |||
90 | 79 | ||
91 | #ifndef __ASSEMBLY__ | 80 | #ifndef __ASSEMBLY__ |
92 | 81 | ||
82 | #define TSB_ENTRY_ALIGNMENT 16 | ||
83 | |||
84 | struct tsb { | ||
85 | unsigned long tag; | ||
86 | unsigned long pte; | ||
87 | } __attribute__((aligned(TSB_ENTRY_ALIGNMENT))); | ||
88 | |||
89 | extern void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte); | ||
90 | extern void tsb_flush(unsigned long ent, unsigned long tag); | ||
91 | extern void tsb_init(struct tsb *tsb, unsigned long size); | ||
92 | |||
93 | typedef struct { | 93 | typedef struct { |
94 | unsigned long sparc64_ctx_val; | 94 | spinlock_t lock; |
95 | unsigned long sparc64_ctx_val; | ||
96 | struct tsb *tsb; | ||
97 | unsigned long tsb_rss_limit; | ||
98 | unsigned long tsb_nentries; | ||
99 | unsigned long tsb_reg_val; | ||
100 | unsigned long tsb_map_vaddr; | ||
101 | unsigned long tsb_map_pte; | ||
102 | struct hv_tsb_descr tsb_descr; | ||
95 | } mm_context_t; | 103 | } mm_context_t; |
96 | 104 | ||
97 | #endif /* !__ASSEMBLY__ */ | 105 | #endif /* !__ASSEMBLY__ */ |