Deleted Added
full compact
tsc.c (223211) tsc.c (223426)
1/*-
2 * Copyright (c) 1998-2003 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998-2003 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/x86/x86/tsc.c 223211 2011-06-17 21:41:06Z jkim $");
28__FBSDID("$FreeBSD: head/sys/x86/x86/tsc.c 223426 2011-06-22 16:40:45Z jkim $");
29
30#include "opt_clock.h"
31
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/cpu.h>
35#include <sys/limits.h>
36#include <sys/malloc.h>

--- 402 unchanged lines hidden (view full) ---

439 */
440 if (power_pm_get_type() == POWER_PM_TYPE_APM) {
441 tsc_timecounter.tc_quality = -1000;
442 if (bootverbose)
443 printf("TSC timecounter disabled: APM enabled.\n");
444 goto init;
445 }
446
29
30#include "opt_clock.h"
31
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/cpu.h>
35#include <sys/limits.h>
36#include <sys/malloc.h>

--- 402 unchanged lines hidden (view full) ---

439 */
440 if (power_pm_get_type() == POWER_PM_TYPE_APM) {
441 tsc_timecounter.tc_quality = -1000;
442 if (bootverbose)
443 printf("TSC timecounter disabled: APM enabled.\n");
444 goto init;
445 }
446
447 /*
448 * We cannot use the TSC if it stops incrementing in deep sleep.
449 * Currently only Intel CPUs are known for this problem unless
450 * the invariant TSC bit is set.
451 */
452 if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL &&
453 (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) {
454 tsc_timecounter.tc_quality = -1000;
455 if (bootverbose)
456 printf("TSC timecounter disabled: C3 enabled.\n");
457 goto init;
458 }
459
447#ifdef SMP
448 /*
449 * We can not use the TSC in SMP mode unless the TSCs on all CPUs are
450 * synchronized. If the user is sure that the system has synchronized
451 * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
452 * We also limit the frequency even lower to avoid "temporal anomalies"
453 * as much as possible.
454 */

--- 133 unchanged lines hidden ---
460#ifdef SMP
461 /*
462 * We can not use the TSC in SMP mode unless the TSCs on all CPUs are
463 * synchronized. If the user is sure that the system has synchronized
464 * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
465 * We also limit the frequency even lower to avoid "temporal anomalies"
466 * as much as possible.
467 */

--- 133 unchanged lines hidden ---