summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-07-26 15:05:29 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-07-26 15:05:29 +0000
commitd103e8b98085dbb5f7707242723b9d3ce74f2723 (patch)
tree263af7aa964a6c36a7cd561cd80268d6cbba5d5d /usr/src/uts/intel/io/acpica/hardware/hwtimer.c
parent9b221abb819d37d8c917941b8348a6c0e49c74b1 (diff)
downloadillumos-joyent-d103e8b98085dbb5f7707242723b9d3ce74f2723.tar.gz
OS-5536 update to ACPI version 6.x
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/intel/io/acpica/hardware/hwtimer.c')
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwtimer.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwtimer.c b/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
index 15dc58f0bf..64b2a8aaf5 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
@@ -1,4 +1,3 @@
-
/******************************************************************************
*
* Name: hwtimer.c - ACPI Power Management Timer Interface
@@ -6,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2012, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include "acpi.h"
#include "accommon.h"
@@ -116,8 +117,14 @@ AcpiGetTimer (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
+ /* ACPI 5.0A: PM Timer is optional */
+
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+ Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
return_ACPI_STATUS (Status);
}
@@ -144,7 +151,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTimer)
* a versatile and accurate timer.
*
* Note that this function accommodates only a single timer
- * rollover. Thus for 24-bit timers, this function should only
+ * rollover. Thus for 24-bit timers, this function should only
* be used for calculating durations less than ~4.6 seconds
* (~20 minutes for 32-bit timers) -- calculations below:
*
@@ -172,6 +179,13 @@ AcpiGetTimerDuration (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ /* ACPI 5.0A: PM Timer is optional */
+
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
/*
* Compute Tick Delta:
* Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
@@ -204,10 +218,11 @@ AcpiGetTimerDuration (
/*
* Compute Duration (Requires a 64-bit multiply and divide):
*
- * TimeElapsed = (DeltaTicks * 1000000) / PM_TIMER_FREQUENCY;
+ * TimeElapsed (microseconds) =
+ * (DeltaTicks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY;
*/
- Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * 1000000,
- PM_TIMER_FREQUENCY, &Quotient, NULL);
+ Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * ACPI_USEC_PER_SEC,
+ ACPI_PM_TIMER_FREQUENCY, &Quotient, NULL);
*TimeElapsed = (UINT32) Quotient;
return_ACPI_STATUS (Status);