X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=PcAtChipsetPkg%2FLibrary%2FAcpiTimerLib%2FDxeAcpiTimerLib.c;fp=PcAtChipsetPkg%2FLibrary%2FAcpiTimerLib%2FDxeAcpiTimerLib.c;h=b141c680fb823c59f08efd624d46a9731b3ff224;hp=7f7b0f8f62947712e3a3a3d66df51ddeece1c14a;hb=a012df5ec643a0c08c2b723a02919a5c9373ca74;hpb=7503cd70fb864a5663edb121c9b2488b4c69e7f5 diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c index 7f7b0f8f62..b141c680fb 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c @@ -20,13 +20,13 @@ Calculate TSC frequency. The TSC counting frequency is determined by comparing how far it counts - during a 100us period as determined by the ACPI timer. The ACPI timer is - used because it counts at a known frequency. - The TSC is sampled, followed by waiting for ACPI_TIMER_FREQUENCY / 10000 - clocks of the ACPI timer, or 100us. The TSC is then sampled again. The - difference multiplied by 10000 is the TSC frequency. There will be a small - error because of the overhead of reading the ACPI timer. An attempt is - made to determine and compensate for this error. + during a 101.4 us period as determined by the ACPI timer. + The ACPI timer is used because it counts at a known frequency. + The TSC is sampled, followed by waiting 363 counts of the ACPI timer, + or 101.4 us. The TSC is then sampled again. The difference multiplied by + 9861 is the TSC frequency. There will be a small error because of the + overhead of reading the ACPI timer. An attempt is made to determine and + compensate for this error. @return The number of TSC counts per second.