Index: sys/arch/i386/isa/clock.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/isa/clock.c,v
retrieving revision 1.47
diff -u -r1.47 clock.c
--- sys/arch/i386/isa/clock.c   10 Nov 2012 09:45:05 -0000      1.47
+++ sys/arch/i386/isa/clock.c   24 Jan 2013 17:38:16 -0000
@@ -378,6 +378,7 @@
 {
        struct cpu_info *ci;
        unsigned long long count, last_count, msr;
+       cpuspeed = 0;
 
        ci = curcpu();
 
@@ -399,12 +400,14 @@
                msr = rdmsr(MSR_PERF_GLOBAL_CTRL);
                msr &= ~MSR_PERF_GLOBAL_CTR1_EN;
                wrmsr(MSR_PERF_GLOBAL_CTRL, msr);
-       } else {
+               cpuspeed = ((count - last_count) + 999999) / 1000000;
+       } 
+       if (cpuspeed == 0) {
                __asm __volatile("rdtsc" : "=A" (last_count));
                delay(1000000);
                __asm __volatile("rdtsc" : "=A" (count));
+               cpuspeed = ((count - last_count) + 999999) / 1000000;
        }
-       cpuspeed = ((count - last_count) + 999999) / 1000000;
 }
 
 void



OpenBSD 5.2-current (GENERIC) #19: Thu Jan 24 17:43:44 CET 2013
    [email protected]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Core(TM) i7 CPU M 640 @ 2.80GHz ("GenuineIntel" 686-class) 2.81 
GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,HTT,NXE,LONG,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,LAHF,PERF,ITSC
real mem  = 2146955264 (2047MB)
avail mem = 2100981760 (2003MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 05/09/07, BIOS32 rev. 0 @ 0xf5000, SMBIOS 
rev. 2.3 @ 0xf6120 (20 entries)
bios0: vendor Parallels Software International Inc. version "6.0.12106.692267" 
date 10/26/2007
bios0: Parallels Software International Inc. Parallels Virtual Platform
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC
acpi0: wakeup devices EXP1(S4) EXP2(S4) EXP3(S4) EXP4(S4) EXP5(S4) EXP6(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 465MHz
ioapic0 at mainbus0: apid 0 pa 0xfec00000, version 2, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PX16)
acpiprt2 at acpi0: bus 2 (PCIN)
acpiprt3 at acpi0: bus 3 (PCI2)
acpiprt4 at acpi0: bus -1 (EXP1)
acpiprt5 at acpi0: bus -1 (EXP2)
acpiprt6 at acpi0: bus -1 (EXP3)
acpiprt7 at acpi0: bus -1 (EXP4)
acpiprt8 at acpi0: bus -1 (EXP5)
acpiprt9 at acpi0: bus -1 (EXP6)
acpiec0 at acpi0
acpicpu0 at acpi0: C1
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "3545797981023400290" type 3545797981023400290 
oem "3545797981025357139"
bios0: ROM list: 0xc0000/0xa000 0xd0000/0x1000
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
0:31:0: mem address conflict 0xd000/0x10
0:31:0: mem address conflict 0x2dff0f0/0x10
pchb0 at pci0 dev 0 function 0 "Intel 82G965 Host" rev 0x02
ppb0 at pci0 dev 1 function 0 "Intel 82G35 PCIE" rev 0x02
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 unknown vendor 0x1ab8 product 0x4005 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
unknown vendor 0x1ab8 product 0x4000 (class undefined unknown subclass 0x00, 
rev 0x00) at pci0 dev 3 function 0 not configured
em0 at pci0 dev 5 function 0 "Intel PRO/1000MT (82545EM)" rev 0x00: apic 0 int 
23, address 00:1c:42:1d:ce:40
ppb1 at pci0 dev 10 function 0 "DEC 21150 PCI-PCI" rev 0x00
pci2 at ppb1 bus 2
ppb2 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xf2
pci3 at ppb2 bus 3
ichpcib0 at pci0 dev 31 function 0 "Intel 82801H LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801BA IDE" rev 0x05: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <Virtual HDD [0]>
wd0: 128-sector PIO, LBA48, 16384MB, 33554432 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <MATSHITA, DVD-R UJ-898, HC10> ATAPI 5/cdrom 
removable
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
cd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 1
pciide0: channel 1 disabled (no drives)
auich0 at pci0 dev 31 function 4 "Intel 82801BA AC97" rev 0x02: apic 0 int 17, 
ICH2 AC97
ac97: codec id 0x414c4710 (Avance Logic ALC200)
audio0 at auich0
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (fdec0729029aa9e4.a) swap on wd0b dump on wd0b

Reply via email to