Subversion Repositories Kolibri OS

Rev

Rev 223 | Rev 313 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 223 Rev 241
Line 179... Line 179...
179
	mov	cl, 20
179
	mov	cl, 20
180
@@:	ret	
180
@@:	ret	
Line 181... Line 181...
181
	
181
 
182
noAMDK6:cmp	byte [CPU_fam], 6
182
noAMDK6:cmp	byte [CPU_fam], 6
-
 
183
	jne	noAMDK7
-
 
184
	cmp	byte [CPU_mod], 5
-
 
185
	jna	@f
-
 
186
	mov	eax, 0x80000007
-
 
187
	cpuid
-
 
188
	and	edx, 6		;  voltage ID control & frequency ID control
-
 
189
	cmp	edx, 6
183
	jne	noAMDK7
190
	je	AMDK7M
184
	mov	eax, 68		; Athlon/AthlonXP
191
@@:	mov	eax, 68		; Athlon/AthlonXP
185
	mov	ebx, 3
192
	mov	ebx, 3
186
	mov	edx, 0x0C0010015
193
	mov	edx, 0x0C0010015
187
	int	0x40
194
	int	0x40
188
	mov	ebx, eax
195
	mov	ebx, eax
189
	shr	ebx, 24
196
	shr	ebx, 24
190
	and	ebx, 0x0F
197
	and	ebx, 0x0F
191
	shr	eax, 20
198
	shr	eax, 20
-
 
199
	jnc	@f
192
	jc	@f
200
	add	bl, 16
193
	mov	cl, [athloncoef + ebx]
201
@@:	mov	cl, [athloncoef + ebx]
-
 
202
	ret
-
 
203
 
-
 
204
AMDK7M:	mov	eax, 68		; AthonXP-M
-
 
205
	mov	ebx, 3
-
 
206
	mov	edx, 0xC0010042
-
 
207
	int	0x40
194
	ret
208
	and	eax, 0x1F
-
 
209
	mov	cl, [athlonmcoef + eax]
-
 
210
	ret
-
 
211
 
-
 
212
noAMDK7:cmp	byte [CPU_fam], 0xF
-
 
213
	jne	noAMDK8
-
 
214
	mov	eax, 0x80000007
-
 
215
	cpuid
-
 
216
	and	edx, 6		;  voltage ID control & frequency ID control
-
 
217
	cmp	edx, 6
-
 
218
	je	AMDK8M
-
 
219
	mov	eax, 68		; Athon64
-
 
220
	mov	ebx, 3
-
 
221
	mov	edx, 0xC0010015
-
 
222
	int	0x40
-
 
223
	shr	eax, 24
-
 
224
	and	al, 0x3F
-
 
225
	shr	al, 1
-
 
226
	add	al, 4
-
 
227
	mov	dl, 10
-
 
228
	mul	dl
-
 
229
	mov	cl, al
-
 
230
	ret
-
 
231
 
-
 
232
AMDK8M:	mov	eax, 68		; Athon64-M
-
 
233
	mov	ebx, 3
-
 
234
	mov	edx, 0xC0010042
-
 
235
	int	0x40
-
 
236
	and	al, 0x3F
-
 
237
	shr	al, 1
-
 
238
	add	al, 4
-
 
239
	mov	dl, 10
-
 
240
	mul	dl
195
@@:	mov	cl, [athloncoef2 + ebx]
241
	mov	cl, al
Line 196... Line 242...
196
	ret
242
	ret
197
	
243
	
198
noAMD:	cmp	dword [Vendor + 8], 'ntel'	; Check for International Electronics CPU
244
noAMD:	cmp	dword [Vendor + 8], 'ntel'	; Check for International Electronics CPU
Line 255... Line 301...
255
@@:
301
@@:
256
	mov	cl, [coppercoeff + eax]
302
	mov	cl, [coppercoeff + eax]
257
	cmp	byte[CPU_mod], 0x0B
303
	cmp	byte[CPU_mod], 0x0B
258
	jb	@f
304
	jb	@f
259
	mov	cl, [tualatcoeff + eax]
305
	mov	cl, [tualatcoeff + eax]
-
 
306
	
-
 
307
	cmp	byte[CPU_mod], 0x0B
-
 
308
	je	@f
-
 
309
	mov	dl, 10		; model 0x0C - 0x0F - Dothan / Yonah  / Conroe / Merom
-
 
310
	mul	dl
-
 
311
	mov	cl, al
-
 
312
	
260
@@:	ret
313
@@:	ret
Line 261... Line 314...
261
 
314
 
262
noIntel:
315
noIntel:
263
noIntelP6:
316
noIntelP6:
264
noAMDK7:
317
noAMDK8:
Line 265... Line 318...
265
	ret
318
	ret
266
 
319
 
-
 
320
athloncoef	db	110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120
-
 
321
		db	190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
267
athloncoef	db	110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105
322
athlonmcoef:	db	110, 115, 120, 125, 50, 55, 60, 65,  70, 75, 80, 85, 90, 95, 100, 105
268
athloncoef2	db	120, 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
323
		db	30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240
269
athloncoef3	db	45, 50, 40, 55, 25, 30, 60, 35
324
athloncoef3	db	45, 50, 40, 55, 25, 30, 60, 35
270
p4coef		db	160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150	; Pentium 4
325
p4coef		db	160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150	; Pentium 4
271
coppercoeff	db	 50, 30, 40, 20, 55, 35,  45, 25,  35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70,  80, 100,  20, 75,  15, 105
326
coppercoeff	db	 50, 30, 40, 20, 55, 35,  45, 25,  35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70,  80, 100,  20, 75,  15, 105