Rev 585 | Rev 709 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 585 | Rev 593 | ||
---|---|---|---|
- | 1 | $Revision: 0 $ |
|
- | 2 | ||
- | 3 | ||
- | 4 | ;cache_ide0_pointer dd 0 |
|
1 | ;cache_ide0_pointer dd 0 |
5 | ;cache_ide0_size dd 0 ; not use |
2 | ;cache_ide0_size dd 0 ; not use |
6 | ;cache_ide0_data_pointer dd 0 |
3 | ;cache_ide0_data_pointer dd 0 |
7 | ;cache_ide0_system_data_size dd 0 ; not use |
4 | ;cache_ide0_system_data_size dd 0 ; not use |
8 | ;cache_ide0_appl_data_size dd 0 ; not use |
5 | ;cache_ide0_appl_data_size dd 0 ; not use |
9 | ;cache_ide0_system_data dd 0 |
6 | ;cache_ide0_system_data dd 0 |
10 | ;cache_ide0_appl_data dd 0 |
7 | ;cache_ide0_appl_data dd 0 |
11 | ;cache_ide0_system_sad_size dd 0 |
8 | ;cache_ide0_system_sad_size dd 0 |
12 | ;cache_ide0_appl_sad_size dd 0 |
9 | ;cache_ide0_appl_sad_size dd 0 |
13 | |
10 | 14 | pusha |
|
11 | pusha |
15 | |
12 | 16 | mov eax,[pg_data.pages_free] |
|
13 | mov eax,[pg_data.pages_free] |
17 | ; 1/32 |
14 | ; 1/32 |
18 | shr eax,5 |
15 | shr eax,5 |
19 | ; round off up to 8 pages |
16 | ; round off up to 8 pages |
20 | shr eax,3 |
17 | shr eax,3 |
21 | shl eax,3 |
18 | shl eax,3 |
22 | ; translate pages in butes *4096 |
19 | ; translate pages in butes *4096 |
23 | shl eax,12 |
20 | shl eax,12 |
24 | ; check a upper size of the cache, no more than 1 Mb on the physical device |
21 | ; check a upper size of the cache, no more than 1 Mb on the physical device |
25 | cmp eax,1024*1024 |
22 | cmp eax,1024*1024 |
26 | jbe @f |
23 | jbe @f |
27 | mov eax,1024*1024 |
24 | mov eax,1024*1024 |
28 | jmp .continue |
25 | jmp .continue |
29 | @@: |
26 | @@: |
30 | ; check a lower size of the cache, not less than 128 Kb on the physical device |
27 | ; check a lower size of the cache, not less than 128 Kb on the physical device |
31 | cmp eax,128*1024 |
28 | cmp eax,128*1024 |
32 | jae @f |
29 | jae @f |
33 | mov eax,128*1024 |
30 | mov eax,128*1024 |
34 | @@: |
31 | @@: |
35 | .continue: |
32 | .continue: |
36 | mov [cache_ide0_size],eax |
33 | mov [cache_ide0_size],eax |
37 | mov [cache_ide1_size],eax |
34 | mov [cache_ide1_size],eax |
38 | mov [cache_ide2_size],eax |
35 | mov [cache_ide2_size],eax |
39 | mov [cache_ide3_size],eax |
36 | mov [cache_ide3_size],eax |
40 | xor eax,eax |
37 | xor eax,eax |
41 | mov [cache_ide0_search_start],eax |
38 | mov [cache_ide0_search_start],eax |
42 | mov [cache_ide0_appl_search_start],eax |
39 | mov [cache_ide0_appl_search_start],eax |
43 | mov [cache_ide1_search_start],eax |
40 | mov [cache_ide1_search_start],eax |
44 | mov [cache_ide1_appl_search_start],eax |
41 | mov [cache_ide1_appl_search_start],eax |
45 | mov [cache_ide2_search_start],eax |
42 | mov [cache_ide2_search_start],eax |
46 | mov [cache_ide2_appl_search_start],eax |
43 | mov [cache_ide2_appl_search_start],eax |
47 | mov [cache_ide3_search_start],eax |
44 | mov [cache_ide3_search_start],eax |
48 | mov [cache_ide3_appl_search_start],eax |
45 | mov [cache_ide3_appl_search_start],eax |
49 | mov [hdd_appl_data],1 ;al |
46 | mov [hdd_appl_data],1 ;al |
50 | mov [cd_appl_data],1 |
47 | mov [cd_appl_data],1 |
51 | |
48 | 52 | mov cl,[DRIVE_DATA+1] |
|
49 | mov cl,[DRIVE_DATA+1] |
53 | mov ch,cl |
50 | mov ch,cl |
54 | and cl,11b |
51 | and cl,11b |
55 | cmp cl,0 |
52 | cmp cl,0 |
56 | je .ide2 |
53 | je .ide2 |
57 | call get_cache_ide3 |
54 | call get_cache_ide3 |
58 | .ide2: |
55 | .ide2: |
59 | mov cl,ch |
56 | mov cl,ch |
60 | and cl,1100b |
57 | and cl,1100b |
61 | cmp cl,0 |
58 | cmp cl,0 |
62 | je .ide1 |
59 | je .ide1 |
63 | call get_cache_ide2 |
60 | call get_cache_ide2 |
64 | .ide1: |
61 | .ide1: |
65 | mov cl,ch |
62 | mov cl,ch |
66 | and cl,110000b |
63 | and cl,110000b |
67 | cmp cl,0 |
64 | cmp cl,0 |
68 | je .ide0 |
65 | je .ide0 |
69 | call get_cache_ide1 |
66 | call get_cache_ide1 |
70 | .ide0: |
67 | .ide0: |
71 | mov cl,ch |
68 | mov cl,ch |
72 | and cl,11000000b |
69 | and cl,11000000b |
73 | cmp cl,0 |
70 | cmp cl,0 |
74 | je end_get_cache |
71 | je end_get_cache |
75 | call get_cache_ide0 |
72 | call get_cache_ide0 |
76 | jmp end_get_cache |
73 | jmp end_get_cache |
77 | |
74 | 78 | get_cache_ide0: |
|
75 | get_cache_ide0: |
79 | push ecx |
76 | push ecx |
80 | stdcall kernel_alloc,[cache_ide0_size] |
77 | stdcall kernel_alloc,[cache_ide0_size] |
81 | mov [cache_ide0_pointer],eax |
78 | mov [cache_ide0_pointer],eax |
82 | pop ecx |
79 | pop ecx |
83 | mov edx,eax |
80 | mov edx,eax |
84 | mov eax,[cache_ide0_size] |
81 | mov eax,[cache_ide0_size] |
85 | shr eax,3 |
82 | shr eax,3 |
86 | mov [cache_ide0_system_data_size],eax |
83 | mov [cache_ide0_system_data_size],eax |
87 | mov ebx,eax |
84 | mov ebx,eax |
88 | imul eax,7 |
85 | imul eax,7 |
89 | mov [cache_ide0_appl_data_size],eax |
86 | mov [cache_ide0_appl_data_size],eax |
90 | add ebx,edx |
87 | add ebx,edx |
91 | mov [cache_ide0_data_pointer],ebx |
88 | mov [cache_ide0_data_pointer],ebx |
92 | |
89 | 93 | cmp cl,10000000b |
|
90 | cmp cl,10000000b |
94 | je .cd |
91 | je .cd |
95 | push ecx |
92 | push ecx |
96 | mov eax,[cache_ide0_system_data_size] |
93 | mov eax,[cache_ide0_system_data_size] |
97 | call calculate_for_hd |
94 | call calculate_for_hd |
98 | add eax,[cache_ide0_pointer] |
95 | add eax,[cache_ide0_pointer] |
99 | mov [cache_ide0_system_data],eax |
96 | mov [cache_ide0_system_data],eax |
100 | mov [cache_ide0_system_sad_size],ecx |
97 | mov [cache_ide0_system_sad_size],ecx |
101 | |
98 | 102 | push edi |
|
99 | push edi |
103 | mov edi,[cache_ide0_pointer] |
100 | mov edi,[cache_ide0_pointer] |
104 | call clear_ide_cache |
101 | call clear_ide_cache |
105 | pop edi |
102 | pop edi |
106 | |
103 | 107 | mov eax,[cache_ide0_appl_data_size] |
|
104 | mov eax,[cache_ide0_appl_data_size] |
108 | call calculate_for_hd |
105 | call calculate_for_hd |
109 | add eax,[cache_ide0_data_pointer] |
106 | add eax,[cache_ide0_data_pointer] |
110 | mov [cache_ide0_appl_data],eax |
107 | mov [cache_ide0_appl_data],eax |
111 | mov [cache_ide0_appl_sad_size],ecx |
108 | mov [cache_ide0_appl_sad_size],ecx |
112 | |
109 | 113 | push edi |
|
110 | push edi |
114 | mov edi,[cache_ide0_data_pointer] |
111 | mov edi,[cache_ide0_data_pointer] |
115 | call clear_ide_cache |
112 | call clear_ide_cache |
116 | pop edi |
113 | pop edi |
117 | |
114 | 118 | pop ecx |
|
115 | pop ecx |
119 | ret |
116 | ret |
120 | .cd: |
117 | .cd: |
121 | push ecx |
118 | push ecx |
122 | mov eax,[cache_ide0_system_data_size] |
119 | mov eax,[cache_ide0_system_data_size] |
123 | call calculate_for_cd |
120 | call calculate_for_cd |
124 | add eax,[cache_ide0_pointer] |
121 | add eax,[cache_ide0_pointer] |
125 | mov [cache_ide0_system_data],eax |
122 | mov [cache_ide0_system_data],eax |
126 | mov [cache_ide0_system_sad_size],ecx |
123 | mov [cache_ide0_system_sad_size],ecx |
127 | |
124 | 128 | push edi |
|
125 | push edi |
129 | mov edi,[cache_ide0_pointer] |
126 | mov edi,[cache_ide0_pointer] |
130 | call clear_ide_cache |
127 | call clear_ide_cache |
131 | pop edi |
128 | pop edi |
132 | |
129 | 133 | mov eax,[cache_ide0_appl_data_size] |
|
130 | mov eax,[cache_ide0_appl_data_size] |
134 | call calculate_for_cd |
131 | call calculate_for_cd |
135 | add eax,[cache_ide0_data_pointer] |
132 | add eax,[cache_ide0_data_pointer] |
136 | mov [cache_ide0_appl_data],eax |
133 | mov [cache_ide0_appl_data],eax |
137 | mov [cache_ide0_appl_sad_size],ecx |
134 | mov [cache_ide0_appl_sad_size],ecx |
138 | |
135 | 139 | push edi |
|
136 | push edi |
140 | mov edi,[cache_ide0_data_pointer] |
137 | mov edi,[cache_ide0_data_pointer] |
141 | call clear_ide_cache |
138 | call clear_ide_cache |
142 | pop edi |
139 | pop edi |
143 | |
140 | 144 | pop ecx |
|
141 | pop ecx |
145 | ret |
142 | ret |
146 | |
143 | 147 | get_cache_ide1: |
|
144 | get_cache_ide1: |
148 | push ecx |
145 | push ecx |
149 | stdcall kernel_alloc,[cache_ide1_size] |
146 | stdcall kernel_alloc,[cache_ide1_size] |
150 | mov [cache_ide1_pointer],eax |
147 | mov [cache_ide1_pointer],eax |
151 | pop ecx |
148 | pop ecx |
152 | mov edx,eax |
149 | mov edx,eax |
153 | mov eax,[cache_ide1_size] |
150 | mov eax,[cache_ide1_size] |
154 | shr eax,3 |
151 | shr eax,3 |
155 | mov [cache_ide1_system_data_size],eax |
152 | mov [cache_ide1_system_data_size],eax |
156 | mov ebx,eax |
153 | mov ebx,eax |
157 | imul eax,7 |
154 | imul eax,7 |
158 | mov [cache_ide1_appl_data_size],eax |
155 | mov [cache_ide1_appl_data_size],eax |
159 | add ebx,edx |
156 | add ebx,edx |
160 | mov [cache_ide1_data_pointer],ebx |
157 | mov [cache_ide1_data_pointer],ebx |
161 | |
158 | 162 | cmp cl,100000b |
|
159 | cmp cl,100000b |
163 | je .cd |
160 | je .cd |
164 | push ecx |
161 | push ecx |
165 | mov eax,[cache_ide1_system_data_size] |
162 | mov eax,[cache_ide1_system_data_size] |
166 | call calculate_for_hd |
163 | call calculate_for_hd |
167 | add eax,[cache_ide1_pointer] |
164 | add eax,[cache_ide1_pointer] |
168 | mov [cache_ide1_system_data],eax |
165 | mov [cache_ide1_system_data],eax |
169 | mov [cache_ide1_system_sad_size],ecx |
166 | mov [cache_ide1_system_sad_size],ecx |
170 | |
167 | 171 | push edi |
|
168 | push edi |
172 | mov edi,[cache_ide1_pointer] |
169 | mov edi,[cache_ide1_pointer] |
173 | call clear_ide_cache |
170 | call clear_ide_cache |
174 | pop edi |
171 | pop edi |
175 | |
172 | 176 | mov eax,[cache_ide1_appl_data_size] |
|
173 | mov eax,[cache_ide1_appl_data_size] |
177 | call calculate_for_hd |
174 | call calculate_for_hd |
178 | add eax,[cache_ide1_data_pointer] |
175 | add eax,[cache_ide1_data_pointer] |
179 | mov [cache_ide1_appl_data],eax |
176 | mov [cache_ide1_appl_data],eax |
180 | mov [cache_ide1_appl_sad_size],ecx |
177 | mov [cache_ide1_appl_sad_size],ecx |
181 | |
178 | 182 | push edi |
|
179 | push edi |
183 | mov edi,[cache_ide1_data_pointer] |
180 | mov edi,[cache_ide1_data_pointer] |
184 | call clear_ide_cache |
181 | call clear_ide_cache |
185 | pop edi |
182 | pop edi |
186 | |
183 | 187 | pop ecx |
|
184 | pop ecx |
188 | ret |
185 | ret |
189 | .cd: |
186 | .cd: |
190 | push ecx |
187 | push ecx |
191 | mov eax,[cache_ide1_system_data_size] |
188 | mov eax,[cache_ide1_system_data_size] |
192 | call calculate_for_cd |
189 | call calculate_for_cd |
193 | add eax,[cache_ide1_pointer] |
190 | add eax,[cache_ide1_pointer] |
194 | mov [cache_ide1_system_data],eax |
191 | mov [cache_ide1_system_data],eax |
195 | mov [cache_ide1_system_sad_size],ecx |
192 | mov [cache_ide1_system_sad_size],ecx |
196 | |
193 | 197 | push edi |
|
194 | push edi |
198 | mov edi,[cache_ide1_pointer] |
195 | mov edi,[cache_ide1_pointer] |
199 | call clear_ide_cache |
196 | call clear_ide_cache |
200 | pop edi |
197 | pop edi |
201 | |
198 | 202 | mov eax,[cache_ide1_appl_data_size] |
|
199 | mov eax,[cache_ide1_appl_data_size] |
203 | call calculate_for_cd |
200 | call calculate_for_cd |
204 | add eax,[cache_ide1_data_pointer] |
201 | add eax,[cache_ide1_data_pointer] |
205 | mov [cache_ide1_appl_data],eax |
202 | mov [cache_ide1_appl_data],eax |
206 | mov [cache_ide1_appl_sad_size],ecx |
203 | mov [cache_ide1_appl_sad_size],ecx |
207 | |
204 | 208 | push edi |
|
205 | push edi |
209 | mov edi,[cache_ide1_data_pointer] |
206 | mov edi,[cache_ide1_data_pointer] |
210 | call clear_ide_cache |
207 | call clear_ide_cache |
211 | pop edi |
208 | pop edi |
212 | |
209 | 213 | pop ecx |
|
210 | pop ecx |
214 | ret |
211 | ret |
215 | |
212 | 216 | get_cache_ide2: |
|
213 | get_cache_ide2: |
217 | push ecx |
214 | push ecx |
218 | stdcall kernel_alloc,[cache_ide2_size] |
215 | stdcall kernel_alloc,[cache_ide2_size] |
219 | mov [cache_ide2_pointer],eax |
216 | mov [cache_ide2_pointer],eax |
220 | pop ecx |
217 | pop ecx |
221 | mov edx,eax |
218 | mov edx,eax |
222 | mov eax,[cache_ide2_size] |
219 | mov eax,[cache_ide2_size] |
223 | shr eax,3 |
220 | shr eax,3 |
224 | mov [cache_ide2_system_data_size],eax |
221 | mov [cache_ide2_system_data_size],eax |
225 | mov ebx,eax |
222 | mov ebx,eax |
226 | imul eax,7 |
223 | imul eax,7 |
227 | mov [cache_ide2_appl_data_size],eax |
224 | mov [cache_ide2_appl_data_size],eax |
228 | add ebx,edx |
225 | add ebx,edx |
229 | mov [cache_ide2_data_pointer],ebx |
226 | mov [cache_ide2_data_pointer],ebx |
230 | |
227 | 231 | cmp cl,1000b |
|
228 | cmp cl,1000b |
232 | je .cd |
229 | je .cd |
233 | push ecx |
230 | push ecx |
234 | mov eax,[cache_ide2_system_data_size] |
231 | mov eax,[cache_ide2_system_data_size] |
235 | call calculate_for_hd |
232 | call calculate_for_hd |
236 | add eax,[cache_ide2_pointer] |
233 | add eax,[cache_ide2_pointer] |
237 | mov [cache_ide2_system_data],eax |
234 | mov [cache_ide2_system_data],eax |
238 | mov [cache_ide2_system_sad_size],ecx |
235 | mov [cache_ide2_system_sad_size],ecx |
239 | |
236 | 240 | push edi |
|
237 | push edi |
241 | mov edi,[cache_ide2_pointer] |
238 | mov edi,[cache_ide2_pointer] |
242 | call clear_ide_cache |
239 | call clear_ide_cache |
243 | pop edi |
240 | pop edi |
244 | |
241 | 245 | mov eax,[cache_ide2_appl_data_size] |
|
242 | mov eax,[cache_ide2_appl_data_size] |
246 | call calculate_for_hd |
243 | call calculate_for_hd |
247 | add eax,[cache_ide2_data_pointer] |
244 | add eax,[cache_ide2_data_pointer] |
248 | mov [cache_ide2_appl_data],eax |
245 | mov [cache_ide2_appl_data],eax |
249 | mov [cache_ide2_appl_sad_size],ecx |
246 | mov [cache_ide2_appl_sad_size],ecx |
250 | |
247 | 251 | push edi |
|
248 | push edi |
252 | mov edi,[cache_ide2_data_pointer] |
249 | mov edi,[cache_ide2_data_pointer] |
253 | call clear_ide_cache |
250 | call clear_ide_cache |
254 | pop edi |
251 | pop edi |
255 | |
252 | 256 | pop ecx |
|
253 | pop ecx |
257 | ret |
254 | ret |
258 | .cd: |
255 | .cd: |
259 | push ecx |
256 | push ecx |
260 | mov eax,[cache_ide2_system_data_size] |
257 | mov eax,[cache_ide2_system_data_size] |
261 | call calculate_for_cd |
258 | call calculate_for_cd |
262 | add eax,[cache_ide2_pointer] |
259 | add eax,[cache_ide2_pointer] |
263 | mov [cache_ide2_system_data],eax |
260 | mov [cache_ide2_system_data],eax |
264 | mov [cache_ide2_system_sad_size],ecx |
261 | mov [cache_ide2_system_sad_size],ecx |
265 | |
262 | 266 | push edi |
|
263 | push edi |
267 | mov edi,[cache_ide2_pointer] |
264 | mov edi,[cache_ide2_pointer] |
268 | call clear_ide_cache |
265 | call clear_ide_cache |
269 | pop edi |
266 | pop edi |
270 | |
267 | 271 | mov eax,[cache_ide2_appl_data_size] |
|
268 | mov eax,[cache_ide2_appl_data_size] |
272 | call calculate_for_cd |
269 | call calculate_for_cd |
273 | add eax,[cache_ide2_data_pointer] |
270 | add eax,[cache_ide2_data_pointer] |
274 | mov [cache_ide2_appl_data],eax |
271 | mov [cache_ide2_appl_data],eax |
275 | mov [cache_ide2_appl_sad_size],ecx |
272 | mov [cache_ide2_appl_sad_size],ecx |
276 | |
273 | 277 | push edi |
|
274 | push edi |
278 | mov edi,[cache_ide2_data_pointer] |
275 | mov edi,[cache_ide2_data_pointer] |
279 | call clear_ide_cache |
276 | call clear_ide_cache |
280 | pop edi |
277 | pop edi |
281 | |
278 | 282 | pop ecx |
|
279 | pop ecx |
283 | ret |
280 | ret |
284 | |
281 | 285 | get_cache_ide3: |
|
282 | get_cache_ide3: |
286 | push ecx |
283 | push ecx |
287 | stdcall kernel_alloc,[cache_ide3_size] |
284 | stdcall kernel_alloc,[cache_ide3_size] |
288 | mov [cache_ide3_pointer],eax |
285 | mov [cache_ide3_pointer],eax |
289 | pop ecx |
286 | pop ecx |
290 | mov edx,eax |
287 | mov edx,eax |
291 | mov eax,[cache_ide3_size] |
288 | mov eax,[cache_ide3_size] |
292 | shr eax,3 |
289 | shr eax,3 |
293 | mov [cache_ide3_system_data_size],eax |
290 | mov [cache_ide3_system_data_size],eax |
294 | mov ebx,eax |
291 | mov ebx,eax |
295 | imul eax,7 |
292 | imul eax,7 |
296 | mov [cache_ide3_appl_data_size],eax |
293 | mov [cache_ide3_appl_data_size],eax |
297 | add ebx,edx |
294 | add ebx,edx |
298 | mov [cache_ide3_data_pointer],ebx |
295 | mov [cache_ide3_data_pointer],ebx |
299 | |
296 | 300 | cmp cl,10b |
|
297 | cmp cl,10b |
301 | je .cd |
298 | je .cd |
302 | push ecx |
299 | push ecx |
303 | mov eax,[cache_ide3_system_data_size] |
300 | mov eax,[cache_ide3_system_data_size] |
304 | call calculate_for_hd |
301 | call calculate_for_hd |
305 | add eax,[cache_ide3_pointer] |
302 | add eax,[cache_ide3_pointer] |
306 | mov [cache_ide3_system_data],eax |
303 | mov [cache_ide3_system_data],eax |
307 | mov [cache_ide3_system_sad_size],ecx |
304 | mov [cache_ide3_system_sad_size],ecx |
308 | |
305 | 309 | push edi |
|
306 | push edi |
310 | mov edi,[cache_ide3_pointer] |
307 | mov edi,[cache_ide3_pointer] |
311 | call clear_ide_cache |
308 | call clear_ide_cache |
312 | pop edi |
309 | pop edi |
313 | |
310 | 314 | mov eax,[cache_ide3_appl_data_size] |
|
311 | mov eax,[cache_ide3_appl_data_size] |
315 | call calculate_for_hd |
312 | call calculate_for_hd |
316 | add eax,[cache_ide3_data_pointer] |
313 | add eax,[cache_ide3_data_pointer] |
317 | mov [cache_ide3_appl_data],eax |
314 | mov [cache_ide3_appl_data],eax |
318 | mov [cache_ide3_appl_sad_size],ecx |
315 | mov [cache_ide3_appl_sad_size],ecx |
319 | |
316 | 320 | push edi |
|
317 | push edi |
321 | mov edi,[cache_ide3_data_pointer] |
318 | mov edi,[cache_ide3_data_pointer] |
322 | call clear_ide_cache |
319 | call clear_ide_cache |
323 | pop edi |
320 | pop edi |
324 | |
321 | 325 | pop ecx |
|
322 | pop ecx |
326 | ret |
323 | ret |
327 | .cd: |
324 | .cd: |
328 | push ecx |
325 | push ecx |
329 | mov eax,[cache_ide3_system_data_size] |
326 | mov eax,[cache_ide3_system_data_size] |
330 | call calculate_for_cd |
327 | call calculate_for_cd |
331 | add eax,[cache_ide3_pointer] |
328 | add eax,[cache_ide3_pointer] |
332 | mov [cache_ide3_system_data],eax |
329 | mov [cache_ide3_system_data],eax |
333 | mov [cache_ide3_system_sad_size],ecx |
330 | mov [cache_ide3_system_sad_size],ecx |
334 | |
331 | 335 | push edi |
|
332 | push edi |
336 | mov edi,[cache_ide3_pointer] |
333 | mov edi,[cache_ide3_pointer] |
337 | call clear_ide_cache |
334 | call clear_ide_cache |
338 | pop edi |
335 | pop edi |
339 | |
336 | 340 | mov eax,[cache_ide3_appl_data_size] |
|
337 | mov eax,[cache_ide3_appl_data_size] |
341 | call calculate_for_cd |
338 | call calculate_for_cd |
342 | add eax,[cache_ide3_data_pointer] |
339 | add eax,[cache_ide3_data_pointer] |
343 | mov [cache_ide3_appl_data],eax |
340 | mov [cache_ide3_appl_data],eax |
344 | mov [cache_ide3_appl_sad_size],ecx |
341 | mov [cache_ide3_appl_sad_size],ecx |
345 | |
342 | 346 | push edi |
|
343 | push edi |
347 | mov edi,[cache_ide3_data_pointer] |
344 | mov edi,[cache_ide3_data_pointer] |
348 | call clear_ide_cache |
345 | call clear_ide_cache |
349 | pop edi |
346 | pop edi |
350 | |
347 | 351 | pop ecx |
|
348 | pop ecx |
352 | ret |
349 | ret |
353 | |
350 | 354 | calculate_for_hd: |
|
351 | calculate_for_hd: |
355 | push eax |
352 | push eax |
356 | mov ebx,eax |
353 | mov ebx,eax |
357 | shr eax,9 |
354 | shr eax,9 |
358 | shl eax,3 |
355 | shl eax,3 |
359 | sub ebx,eax |
356 | sub ebx,eax |
360 | shr ebx,9 |
357 | shr ebx,9 |
361 | mov ecx,ebx |
358 | mov ecx,ebx |
362 | shl ebx,9 |
359 | shl ebx,9 |
363 | pop eax |
360 | pop eax |
364 | sub eax,ebx |
361 | sub eax,ebx |
365 | dec ecx |
362 | dec ecx |
366 | ret |
363 | ret |
367 | |
364 | 368 | calculate_for_cd: |
|
365 | calculate_for_cd: |
369 | push eax |
366 | push eax |
370 | mov ebx,eax |
367 | mov ebx,eax |
371 | shr eax,11 |
368 | shr eax,11 |
372 | shl eax,3 |
369 | shl eax,3 |
373 | sub ebx,eax |
370 | sub ebx,eax |
374 | shr ebx,11 |
371 | shr ebx,11 |
375 | mov ecx,ebx |
372 | mov ecx,ebx |
376 | shl ebx,11 |
373 | shl ebx,11 |
377 | pop eax |
374 | pop eax |
378 | sub eax,ebx |
375 | sub eax,ebx |
379 | dec ecx |
376 | dec ecx |
380 | ret |
377 | ret |
381 | |
378 | 382 | clear_ide_cache: |
|
379 | clear_ide_cache: |
383 | push eax |
380 | push eax |
384 | shl ecx,1 |
381 | shl ecx,1 |
385 | xor eax,eax |
382 | xor eax,eax |
386 | cld |
383 | cld |
387 | rep stosd |
384 | rep stosd |
388 | pop eax |
385 | pop eax |
389 | ret |
386 | ret |
390 | |
387 | 391 | end_get_cache: |
|
388 | end_get_cache: |
392 | ; mov [cache_ide0_pointer],HD_CACHE |
389 | ; mov [cache_ide0_pointer],HD_CACHE |
393 | ; mov [cache_ide0_system_data],HD_CACHE+65536 |
390 | ; mov [cache_ide0_system_data],HD_CACHE+65536 |
394 | ; mov [cache_ide0_system_sad_size],1919 |
391 | ; mov [cache_ide0_system_sad_size],1919 |
395 | popa |
392 | popa |
- |