Rev 1890 | Rev 1954 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1890 | Rev 1891 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | */ |
33 | */ |
34 | 34 | ||
35 | #ifndef KERN_sparc64_TSB_H_ |
35 | #ifndef KERN_sparc64_TSB_H_ |
36 | #define KERN_sparc64_TSB_H_ |
36 | #define KERN_sparc64_TSB_H_ |
37 | 37 | ||
38 | #include <arch/mm/tte.h> |
- | |
39 | #include <arch/mm/mmu.h> |
- | |
40 | #include <arch/types.h> |
- | |
41 | #include <typedefs.h> |
- | |
42 | - | ||
43 | /* |
38 | /* |
44 | * ITSB abd DTSB will claim 64K of memory, which |
39 | * ITSB abd DTSB will claim 64K of memory, which |
45 | * is a nice number considered that it is one of |
40 | * is a nice number considered that it is one of |
46 | * the page sizes supported by hardware, which, |
41 | * the page sizes supported by hardware, which, |
47 | * again, is nice because TSBs need to be locked |
42 | * again, is nice because TSBs need to be locked |
Line 49... | Line 44... | ||
49 | */ |
44 | */ |
50 | #define TSB_SIZE 2 /* when changing this, change as.c as well */ |
45 | #define TSB_SIZE 2 /* when changing this, change as.c as well */ |
51 | #define ITSB_ENTRY_COUNT (512*(1<<TSB_SIZE)) |
46 | #define ITSB_ENTRY_COUNT (512*(1<<TSB_SIZE)) |
52 | #define DTSB_ENTRY_COUNT (512*(1<<TSB_SIZE)) |
47 | #define DTSB_ENTRY_COUNT (512*(1<<TSB_SIZE)) |
53 | 48 | ||
- | 49 | #define TSB_TAG_TARGET_CONTEXT_SHIFT 48 |
|
- | 50 | ||
- | 51 | #ifndef __ASM__ |
|
- | 52 | ||
- | 53 | #include <arch/mm/tte.h> |
|
- | 54 | #include <arch/mm/mmu.h> |
|
- | 55 | #include <arch/types.h> |
|
- | 56 | #include <typedefs.h> |
|
- | 57 | ||
- | 58 | /** TSB Tag Target register. */ |
|
- | 59 | union tsb_tag_target { |
|
- | 60 | uint64_t value; |
|
- | 61 | struct { |
|
- | 62 | unsigned invalid : 1; /**< Invalidated by software. */ |
|
- | 63 | unsigned : 2; |
|
- | 64 | unsigned context : 13; /**< Software ASID. */ |
|
- | 65 | unsigned : 6; |
|
- | 66 | uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */ |
|
- | 67 | } __attribute__ ((packed)); |
|
- | 68 | }; |
|
- | 69 | typedef union tsb_tag_target tsb_tag_target_t; |
|
- | 70 | ||
- | 71 | /** TSB entry. */ |
|
54 | struct tsb_entry { |
72 | struct tsb_entry { |
55 | tte_tag_t tag; |
73 | tsb_tag_target_t tag; |
56 | tte_data_t data; |
74 | tte_data_t data; |
57 | } __attribute__ ((packed)); |
75 | } __attribute__ ((packed)); |
58 | typedef struct tsb_entry tsb_entry_t; |
76 | typedef struct tsb_entry tsb_entry_t; |
59 | 77 | ||
60 | /** TSB Base register. */ |
78 | /** TSB Base register. */ |
Line 107... | Line 125... | ||
107 | { |
125 | { |
108 | asi_u64_write(ASI_DMMU, VA_DMMU_TSB_BASE, v); |
126 | asi_u64_write(ASI_DMMU, VA_DMMU_TSB_BASE, v); |
109 | } |
127 | } |
110 | 128 | ||
111 | extern void tsb_invalidate(as_t *as, uintptr_t page, count_t pages); |
129 | extern void tsb_invalidate(as_t *as, uintptr_t page, count_t pages); |
- | 130 | extern void itsb_pte_copy(pte_t *t); |
|
- | 131 | extern void dtsb_pte_copy(pte_t *t, bool ro); |
|
- | 132 | ||
- | 133 | #endif /* !def __ASM__ */ |
|
112 | 134 | ||
113 | #endif |
135 | #endif |
114 | 136 | ||
115 | /** @} |
137 | /** @} |
116 | */ |
138 | */ |