Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 If the USE_PLATFORM_CLOCK flag is set in th...



details:   https://anonhg.NetBSD.org/src/rev/0f373ea9cc43
branches:  trunk
changeset: 768087:0f373ea9cc43
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Aug 08 11:18:34 2011 +0000

description:
If the USE_PLATFORM_CLOCK flag is set in the FADT, it indicates that OSPM
should use a platform provided timer (either HPET or the PM timer). A
platform may set this flag if internal processor clock(s) cannot provide
consistent monotonically non-decreasing counters. Set TSC quality to -100
if this flag is set.

diffstat:

 sys/arch/x86/x86/tsc.c |  24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r 3c2ccd68c160 -r 0f373ea9cc43 sys/arch/x86/x86/tsc.c
--- a/sys/arch/x86/x86/tsc.c    Mon Aug 08 06:30:43 2011 +0000
+++ b/sys/arch/x86/x86/tsc.c    Mon Aug 08 11:18:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tsc.c,v 1.28 2011/02/02 12:26:42 bouyer Exp $  */
+/*     $NetBSD: tsc.c,v 1.29 2011/08/08 11:18:34 jmcneill Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.28 2011/02/02 12:26:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.29 2011/08/08 11:18:34 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,6 +45,11 @@
 #include <machine/cputypes.h>
 
 #include "tsc.h"
+#include "acpica.h"
+
+#if NACPICA > 0
+#include <dev/acpi/acpivar.h>
+#endif
 
 u_int  tsc_get_timecount(struct timecounter *);
 
@@ -143,6 +148,21 @@
                safe = false;
        }
 
+#if NACPICA > 0
+       /*
+        * If the USE_PLATFORM_CLOCK flag is set in the FADT, it indicates
+        * that OSPM should use a platform provided timer (either HPET or
+        * the PM timer). A platform may set this flag if internal
+        * processor clock(s) cannot provide consistent monotonically
+        * non-decreasing counters.
+        */
+       if (acpi_active && (AcpiGbl_FADT.Flags & ACPI_FADT_PLATFORM_CLOCK)) {
+               aprint_debug("TSC: ACPI requested platform-provided timer\n");
+               tsc_timecounter.tc_quality = -100;
+               safe = false;
+       }
+#endif
+
        if (tsc_freq != 0) {
                tsc_timecounter.tc_frequency = tsc_freq;
                tc_init(&tsc_timecounter);



Home | Main Index | Thread Index | Old Index