identcpu.c (35456) | identcpu.c (36200) |
---|---|
1/* 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. 4 * Copyright (c) 1997 KATO Takenori. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * William Jolitz. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp | 1/* 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. 4 * Copyright (c) 1997 KATO Takenori. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * William Jolitz. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp |
39 * $Id: identcpu.c,v 1.44 1998/04/15 17:44:58 bde Exp $ | 39 * $Id: identcpu.c,v 1.45 1998/04/26 03:18:38 dyson Exp $ |
40 */ 41 42#include "opt_cpu.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/kernel.h> 47#include <sys/sysctl.h> --- 375 unchanged lines hidden (view full) --- 423 if(*cpu_vendor) 424 printf(" Origin = \"%s\"",cpu_vendor); 425 if(cpu_id) 426 printf(" Id = 0x%lx",cpu_id); 427 428 if (strcmp(cpu_vendor, "GenuineIntel") == 0 || 429 strcmp(cpu_vendor, "AuthenticAMD") == 0 || 430 ((strcmp(cpu_vendor, "CyrixInstead") == 0) && | 40 */ 41 42#include "opt_cpu.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/kernel.h> 47#include <sys/sysctl.h> --- 375 unchanged lines hidden (view full) --- 423 if(*cpu_vendor) 424 printf(" Origin = \"%s\"",cpu_vendor); 425 if(cpu_id) 426 printf(" Id = 0x%lx",cpu_id); 427 428 if (strcmp(cpu_vendor, "GenuineIntel") == 0 || 429 strcmp(cpu_vendor, "AuthenticAMD") == 0 || 430 ((strcmp(cpu_vendor, "CyrixInstead") == 0) && |
431 (cpu_id & 0xf00 > 5))) { | 431 ((cpu_id & 0xf00) > 5))) { |
432 printf(" Stepping=%ld", cpu_id & 0xf); | 432 printf(" Stepping=%ld", cpu_id & 0xf); |
433 if (strcmp(cpu_vendor, "CyrixInstead") == 0) 434 printf(" DIR=0x%04lx", cyrix_did); |
|
433 if (cpu_high > 0) { 434 /* 435 * Here we should probably set up flags indicating 436 * whether or not various features are available. 437 * The interesting ones are probably VME, PSE, PAE, 438 * and PGE. The code already assumes without bothering 439 * to check that all CPUs >= Pentium have a TSC and 440 * MSRs. --- 30 unchanged lines hidden (view full) --- 471 "\034<b27>" 472 "\035<b28>" 473 "\036<b29>" 474 "\037<b30>" 475 "\040<b31>" 476 ); 477 } 478 } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { | 435 if (cpu_high > 0) { 436 /* 437 * Here we should probably set up flags indicating 438 * whether or not various features are available. 439 * The interesting ones are probably VME, PSE, PAE, 440 * and PGE. The code already assumes without bothering 441 * to check that all CPUs >= Pentium have a TSC and 442 * MSRs. --- 30 unchanged lines hidden (view full) --- 473 "\034<b27>" 474 "\035<b28>" 475 "\036<b29>" 476 "\037<b30>" 477 "\040<b31>" 478 ); 479 } 480 } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { |
479 printf(" DIR=0x%lx", cyrix_did); | 481 printf(" DIR=0x%04lx", cyrix_did); |
480 printf(" Stepping=%ld", (cyrix_did & 0xf000) >> 12); | 482 printf(" Stepping=%ld", (cyrix_did & 0xf000) >> 12); |
481 printf(" Revision=%ld", (cyrix_did & 0x0fff) >> 8); | 483 printf(" Revision=%ld", (cyrix_did & 0x0f00) >> 8); |
482#ifndef CYRIX_CACHE_REALLY_WORKS 483 if (cpu == CPU_M1 && (cyrix_did & 0xff00) < 0x1700) 484 printf("\n CPU cache: write-through mode"); 485#endif 486 } 487 /* Avoid ugly blank lines: only print newline when we have to. */ 488 if (*cpu_vendor || cpu_id) 489 printf("\n"); --- 192 unchanged lines hidden (view full) --- 682 } 683 } 684 switch (cpu_id & 0xf00) { 685 case 0x600: 686 /* 687 * Cyrix's datasheet does not describe DIRs. 688 * Therefor, I assume it does not have them 689 * and use the result of the cpuid instruction. | 484#ifndef CYRIX_CACHE_REALLY_WORKS 485 if (cpu == CPU_M1 && (cyrix_did & 0xff00) < 0x1700) 486 printf("\n CPU cache: write-through mode"); 487#endif 488 } 489 /* Avoid ugly blank lines: only print newline when we have to. */ 490 if (*cpu_vendor || cpu_id) 491 printf("\n"); --- 192 unchanged lines hidden (view full) --- 684 } 685 } 686 switch (cpu_id & 0xf00) { 687 case 0x600: 688 /* 689 * Cyrix's datasheet does not describe DIRs. 690 * Therefor, I assume it does not have them 691 * and use the result of the cpuid instruction. |
692 * XXX they seem to have it for now at least. -Peter |
|
690 */ 691 identifycyrix(); 692 cpu = CPU_M2; 693 break; 694 default: 695 identifycyrix(); 696 /* 697 * This routine contains a trick. --- 27 unchanged lines hidden (view full) --- 725 /* 726 * enable cpuid instruction. 727 */ 728 ccr3 = read_cyrix_reg(CCR3); 729 write_cyrix_reg(CCR3, CCR3_MAPEN0); 730 write_cyrix_reg(CCR4, read_cyrix_reg(CCR4) | CCR4_CPUID); 731 write_cyrix_reg(CCR3, ccr3); 732 | 693 */ 694 identifycyrix(); 695 cpu = CPU_M2; 696 break; 697 default: 698 identifycyrix(); 699 /* 700 * This routine contains a trick. --- 27 unchanged lines hidden (view full) --- 728 /* 729 * enable cpuid instruction. 730 */ 731 ccr3 = read_cyrix_reg(CCR3); 732 write_cyrix_reg(CCR3, CCR3_MAPEN0); 733 write_cyrix_reg(CCR4, read_cyrix_reg(CCR4) | CCR4_CPUID); 734 write_cyrix_reg(CCR3, ccr3); 735 |
736 do_cpuid(0, regs); 737 cpu_high = regs[0]; /* eax */ |
|
733 do_cpuid(1, regs); 734 cpu_id = regs[0]; /* eax */ 735 cpu_feature = regs[3]; /* edx */ 736 break; 737 } 738 } 739 } 740} --- 47 unchanged lines hidden --- | 738 do_cpuid(1, regs); 739 cpu_id = regs[0]; /* eax */ 740 cpu_feature = regs[3]; /* edx */ 741 break; 742 } 743 } 744 } 745} --- 47 unchanged lines hidden --- |