Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Update: cpuctl fails to identify AMD quad-core Phenom processor

On Thu, 15 May 2008, Paul Goyette wrote:

1261            for (i = 1; i < sizeof(__arraycount(amd_brand)); i++)

Pardon me for my ignorance, but shouldn't this read

1261            for (i = 1; i < __arraycount(amd_brand); i++)

I mean, why do we care about the sizeof() the number of entries in the array - we care about the actual number of entries!

On AMD64 sizeof() would always be 8, so it would never strop reading the array after index 4!

Making the above change now gives me the following results on the quad-core Phenom machine:

speedy:paul {101} ./cpuctl identify 0
cpu0: AMD Unknown K8 (Athlon) (686-class), 2310.82 MHz, id 0x100f22
cpu0: features ffdbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features ffdbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,NOX,MMXX,MMX>
cpu0: features ffdbfbff<FXSR,SSE,SSE2,RDTSCP,HTT,LONG,3DNOW2,3DNOW>
cpu0: features2 802009<SSE3,MONITOR,CX16,POPCNT>
cpu0: "AMD Phenom(tm) 9600 Quad-Core Processor"
cpu0: I-cache 64kB 64B/line 2-way, D-cache 64kB 64B/line 2-way
cpu0: L2 cache 512kB 64B/line 16-way
cpu0: ITLB 32 4096B entries fully associative, 16 4194304B entries fully 
cpu0: DTLB 48 4096B entries fully associative, 48 4194304B entries fully 
cpu0: Initial APIC ID 2
cpu0: family 0f model 02 extfamily 01 extmodel 00
speedy:paul {102}

|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | |

Home | Main Index | Thread Index | Old Index