Rev 1787 | Rev 1851 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1850 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup ia64mm |
29 | /** @addtogroup ia64mm |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** @file |
32 | /** @file |
33 | */ |
33 | */ |
34 | 34 | ||
Line 54... | Line 54... | ||
54 | #include <interrupt.h> |
54 | #include <interrupt.h> |
55 | 55 | ||
56 | /** Invalidate all TLB entries. */ |
56 | /** Invalidate all TLB entries. */ |
57 | void tlb_invalidate_all(void) |
57 | void tlb_invalidate_all(void) |
58 | { |
58 | { |
59 | ipl_t ipl; |
59 | ipl_t ipl; |
60 | uintptr_t adr; |
60 | uintptr_t adr; |
61 | uint32_t count1, count2, stride1, stride2; |
61 | uint32_t count1, count2, stride1, stride2; |
62 | 62 | ||
63 | int i,j; |
63 | int i, j; |
64 | 64 | ||
65 | adr = PAL_PTCE_INFO_BASE(); |
65 | adr = PAL_PTCE_INFO_BASE(); |
66 | count1 = PAL_PTCE_INFO_COUNT1(); |
66 | count1 = PAL_PTCE_INFO_COUNT1(); |
67 | count2 = PAL_PTCE_INFO_COUNT2(); |
67 | count2 = PAL_PTCE_INFO_COUNT2(); |
68 | stride1 = PAL_PTCE_INFO_STRIDE1(); |
68 | stride1 = PAL_PTCE_INFO_STRIDE1(); |
69 | stride2 = PAL_PTCE_INFO_STRIDE2(); |
69 | stride2 = PAL_PTCE_INFO_STRIDE2(); |
70 | 70 | ||
71 | ipl = interrupts_disable(); |
71 | ipl = interrupts_disable(); |
72 | 72 | ||
73 | for(i = 0; i < count1; i++) { |
73 | for(i = 0; i < count1; i++) { |
74 | for(j = 0; j < count2; j++) { |
74 | for(j = 0; j < count2; j++) { |
75 | __asm__ volatile ( |
75 | __asm__ volatile ( |
76 | "ptc.e %0 ;;" |
76 | "ptc.e %0 ;;" |
77 | : |
77 | : |
78 | : "r" (adr) |
78 | : "r" (adr) |
79 | ); |
79 | ); |
80 | adr += stride2; |
80 | adr += stride2; |
81 | } |
- | |
82 | adr += stride1; |
- | |
83 | } |
81 | } |
- | 82 | adr += stride1; |
|
- | 83 | } |
|
84 | 84 | ||
85 | interrupts_restore(ipl); |
85 | interrupts_restore(ipl); |
86 | 86 | ||
87 | srlz_d(); |
87 | srlz_d(); |
88 | srlz_i(); |
88 | srlz_i(); |
89 | #ifdef CONFIG_VHPT |
89 | #ifdef CONFIG_VHPT |
90 | vhpt_invalidate_all(); |
90 | vhpt_invalidate_all(); |
91 | #endif |
91 | #endif |
92 | } |
92 | } |
93 | 93 | ||
94 | /** Invalidate entries belonging to an address space. |
94 | /** Invalidate entries belonging to an address space. |
95 | * |
95 | * |
Line 130... | Line 130... | ||
130 | b++; |
130 | b++; |
131 | b >>= 1; |
131 | b >>= 1; |
132 | uint64_t ps; |
132 | uint64_t ps; |
133 | 133 | ||
134 | switch (b) { |
134 | switch (b) { |
135 | case 0: /*cnt 1-3*/ |
135 | case 0: /*cnt 1-3*/ |
136 | ps = PAGE_WIDTH; |
136 | ps = PAGE_WIDTH; |
137 | break; |
137 | break; |
138 | case 1: /*cnt 4-15*/ |
138 | case 1: /*cnt 4-15*/ |
139 | /*cnt=((cnt-1)/4)+1;*/ |
139 | /*cnt=((cnt-1)/4)+1;*/ |
140 | ps = PAGE_WIDTH+2; |
140 | ps = PAGE_WIDTH+2; |
141 | va &= ~((1<<ps)-1); |
141 | va &= ~((1<<ps)-1); |
142 | break; |
142 | break; |
143 | case 2: /*cnt 16-63*/ |
143 | case 2: /*cnt 16-63*/ |
144 | /*cnt=((cnt-1)/16)+1;*/ |
144 | /*cnt=((cnt-1)/16)+1;*/ |
145 | ps = PAGE_WIDTH+4; |
145 | ps = PAGE_WIDTH+4; |
146 | va &= ~((1<<ps)-1); |
146 | va &= ~((1<<ps)-1); |
147 | break; |
147 | break; |
148 | case 3: /*cnt 64-255*/ |
148 | case 3: /*cnt 64-255*/ |
149 | /*cnt=((cnt-1)/64)+1;*/ |
149 | /*cnt=((cnt-1)/64)+1;*/ |
150 | ps = PAGE_WIDTH+6; |
150 | ps = PAGE_WIDTH+6; |
151 | va &= ~((1<<ps)-1); |
151 | va &= ~((1<<ps)-1); |
152 | break; |
152 | break; |
153 | case 4: /*cnt 256-1023*/ |
153 | case 4: /*cnt 256-1023*/ |
154 | /*cnt=((cnt-1)/256)+1;*/ |
154 | /*cnt=((cnt-1)/256)+1;*/ |
155 | ps = PAGE_WIDTH+8; |
155 | ps = PAGE_WIDTH+8; |
156 | va &= ~((1<<ps)-1); |
156 | va &= ~((1<<ps)-1); |
157 | break; |
157 | break; |
158 | case 5: /*cnt 1024-4095*/ |
158 | case 5: /*cnt 1024-4095*/ |
159 | /*cnt=((cnt-1)/1024)+1;*/ |
159 | /*cnt=((cnt-1)/1024)+1;*/ |
160 | ps = PAGE_WIDTH+10; |
160 | ps = PAGE_WIDTH+10; |
161 | va &= ~((1<<ps)-1); |
161 | va &= ~((1<<ps)-1); |
162 | break; |
162 | break; |
163 | case 6: /*cnt 4096-16383*/ |
163 | case 6: /*cnt 4096-16383*/ |
164 | /*cnt=((cnt-1)/4096)+1;*/ |
164 | /*cnt=((cnt-1)/4096)+1;*/ |
165 | ps = PAGE_WIDTH+12; |
165 | ps = PAGE_WIDTH+12; |
166 | va &= ~((1<<ps)-1); |
166 | va &= ~((1<<ps)-1); |
167 | break; |
167 | break; |
168 | case 7: /*cnt 16384-65535*/ |
168 | case 7: /*cnt 16384-65535*/ |
169 | case 8: /*cnt 65536-(256K-1)*/ |
169 | case 8: /*cnt 65536-(256K-1)*/ |
170 | /*cnt=((cnt-1)/16384)+1;*/ |
170 | /*cnt=((cnt-1)/16384)+1;*/ |
171 | ps = PAGE_WIDTH+14; |
171 | ps = PAGE_WIDTH+14; |
172 | va &= ~((1<<ps)-1); |
172 | va &= ~((1<<ps)-1); |
173 | break; |
173 | break; |
174 | default: |
174 | default: |
175 | /*cnt=((cnt-1)/(16384*16))+1;*/ |
175 | /*cnt=((cnt-1)/(16384*16))+1;*/ |
176 | ps=PAGE_WIDTH+18; |
176 | ps=PAGE_WIDTH+18; |
177 | va&=~((1<<ps)-1); |
177 | va&=~((1<<ps)-1); |
178 | break; |
178 | break; |
179 | } |
179 | } |
180 | /*cnt+=(page!=va);*/ |
180 | /*cnt+=(page!=va);*/ |
181 | for(; va<(page+cnt*(PAGE_SIZE)); va += (1<<ps)) { |
181 | for(; va<(page+cnt*(PAGE_SIZE)); va += (1<<ps)) { |
182 | __asm__ volatile ( |
182 | __asm__ volatile ( |
183 | "ptc.l %0,%1;;" |
183 | "ptc.l %0,%1;;" |
Line 683... | Line 683... | ||
683 | panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rid); |
683 | panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rid); |
684 | } |
684 | } |
685 | } |
685 | } |
686 | } |
686 | } |
687 | 687 | ||
688 | /** @} |
688 | /** @} |
689 | */ |
689 | */ |
690 | - |