Rev 4923 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4923 | Rev 5116 | ||
---|---|---|---|
Line 343... | Line 343... | ||
343 | 343 | ||
344 | align 4 |
344 | align 4 |
345 | proc test_cpu |
345 | proc test_cpu |
346 | locals |
346 | locals |
347 | cpu_type dd ? |
- | |
348 | cpu_id dd ? |
- | |
349 | cpu_Intel dd ? |
- | |
350 | cpu_AMD dd ? |
347 | cpu_type dd ? |
Line 351... | Line 348... | ||
351 | endl |
348 | endl |
352 | 349 | ||
353 | xor eax, eax |
350 | xor eax, eax |
Line 384... | Line 381... | ||
384 | cpuid |
381 | cpuid |
Line 385... | Line 382... | ||
385 | 382 | ||
386 | mov [cpu_vendor-OS_BASE], ebx |
383 | mov [cpu_vendor-OS_BASE], ebx |
387 | mov [cpu_vendor+4-OS_BASE], edx |
384 | mov [cpu_vendor+4-OS_BASE], edx |
388 | mov [cpu_vendor+8-OS_BASE], ecx |
- | |
389 | cmp ebx, dword [intel_str-OS_BASE] |
- | |
390 | jne .check_AMD |
- | |
391 | cmp edx, dword [intel_str+4-OS_BASE] |
- | |
392 | jne .check_AMD |
- | |
393 | cmp ecx, dword [intel_str+8-OS_BASE] |
- | |
394 | jne .check_AMD |
- | |
- | 385 | mov [cpu_vendor+8-OS_BASE], ecx |
|
395 | mov [cpu_Intel], 1 |
386 | |
396 | cmp eax, 1 |
387 | cmp eax, 1 |
397 | jl .end_cpuid |
388 | jl .end_cpuid |
398 | mov eax, 1 |
389 | mov eax, 1 |
399 | cpuid |
390 | cpuid |
Line 420... | Line 411... | ||
420 | and eax, 0x0f |
411 | and eax, 0x0f |
421 | ret |
412 | ret |
422 | .end_cpuid: |
413 | .end_cpuid: |
423 | mov eax, [cpu_type] |
414 | mov eax, [cpu_type] |
424 | ret |
415 | ret |
425 | - | ||
426 | .check_AMD: |
- | |
427 | cmp ebx, dword [AMD_str-OS_BASE] |
- | |
428 | jne .unknown |
- | |
429 | cmp edx, dword [AMD_str+4-OS_BASE] |
- | |
430 | jne .unknown |
- | |
431 | cmp ecx, dword [AMD_str+8-OS_BASE] |
- | |
432 | jne .unknown |
- | |
433 | mov [cpu_AMD], 1 |
- | |
434 | cmp eax, 1 |
- | |
435 | jl .unknown |
- | |
436 | mov eax, 1 |
- | |
437 | cpuid |
- | |
438 | mov [cpu_sign-OS_BASE], eax |
- | |
439 | mov [cpu_info-OS_BASE], ebx |
- | |
440 | mov [cpu_caps-OS_BASE], edx |
- | |
441 | mov [cpu_caps+4-OS_BASE], ecx |
- | |
442 | shr eax, 8 |
- | |
443 | and eax, 0x0f |
- | |
444 | ret |
- | |
445 | .unknown: |
- | |
446 | mov eax, 1 |
- | |
447 | cpuid |
- | |
448 | mov [cpu_sign-OS_BASE], eax |
- | |
449 | mov [cpu_info-OS_BASE], ebx |
- | |
450 | mov [cpu_caps-OS_BASE], edx |
- | |
451 | mov [cpu_caps+4-OS_BASE], ecx |
- | |
452 | shr eax, 8 |
- | |
453 | and eax, 0x0f |
- | |
454 | ret |
- | |
455 | endp |
416 | endp |
Line 456... | Line 417... | ||
456 | 417 | ||
457 | iglobal |
418 | iglobal |
458 | align 4 |
419 | align 4 |