summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2016-05-23 23:54:43 +0800
committerLv Zheng <lv.zheng@intel.com>2016-06-06 12:58:33 +0800
commitfeba919da450b9cf6a3caad0b5260b19d1ad9e41 (patch)
treed2cc0c64416a88b0504b184845e2db39c31c9216
parent27a9dec7e5d613e1be7419a362676609a8a92cc6 (diff)
downloadacpica-feba919da450b9cf6a3caad0b5260b19d1ad9e41.tar.gz
EFI: Add AcpiOsStall()/AcpiOsSleep() support
This patch adds AcpiOsStall() and AcpiOsSleep() support. Currently we do not support asynchronous polling of key stroke and timer, so AcpiOsSleep() is simply an invocation of AcpiOsStall(). Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
-rw-r--r--source/include/platform/acefiex.h8
-rw-r--r--source/os_specific/service_layers/osefixf.c45
2 files changed, 51 insertions, 2 deletions
diff --git a/source/include/platform/acefiex.h b/source/include/platform/acefiex.h
index fc1438738..1b74b545b 100644
--- a/source/include/platform/acefiex.h
+++ b/source/include/platform/acefiex.h
@@ -548,6 +548,11 @@ EFI_STATUS
typedef
EFI_STATUS
+(EFIAPI *EFI_STALL) (
+ UINTN Microseconds);
+
+typedef
+EFI_STATUS
(EFIAPI *EFI_SET_WATCHDOG_TIMER) (
UINTN Timeout,
UINT64 WatchdogCode,
@@ -862,12 +867,11 @@ typedef struct _EFI_BOOT_SERVICES {
#if 0
EFI_EXIT_BOOT_SERVICES ExitBootServices;
EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
- EFI_STALL Stall;
#else
EFI_UNKNOWN_INTERFACE ExitBootServices;
EFI_UNKNOWN_INTERFACE GetNextMonotonicCount;
- EFI_UNKNOWN_INTERFACE Stall;
#endif
+ EFI_STALL Stall;
EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
#if 0
diff --git a/source/os_specific/service_layers/osefixf.c b/source/os_specific/service_layers/osefixf.c
index 439494cbc..193381d00 100644
--- a/source/os_specific/service_layers/osefixf.c
+++ b/source/os_specific/service_layers/osefixf.c
@@ -707,6 +707,51 @@ AcpiOsGetTimer (
/******************************************************************************
*
+ * FUNCTION: AcpiOsStall
+ *
+ * PARAMETERS: microseconds - Time to sleep
+ *
+ * RETURN: Blocks until sleep is completed.
+ *
+ * DESCRIPTION: Sleep at microsecond granularity
+ *
+ *****************************************************************************/
+
+void
+AcpiOsStall (
+ UINT32 microseconds)
+{
+
+ if (microseconds)
+ {
+ uefi_call_wrapper (BS->Stall, 1, microseconds);
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsSleep
+ *
+ * PARAMETERS: milliseconds - Time to sleep
+ *
+ * RETURN: Blocks until sleep is completed.
+ *
+ * DESCRIPTION: Sleep at millisecond granularity
+ *
+ *****************************************************************************/
+
+void
+AcpiOsSleep (
+ UINT64 milliseconds)
+{
+
+ AcpiOsStall (milliseconds * ACPI_USEC_PER_MSEC);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size - Amount to allocate, in bytes