--- /dev/null
+/** @file\r
+ This file declares EFI Smm Periodic Timer Smi Child Protocol\r
+\r
+ Copyright (c) 2006, Intel Corporation \r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ Module Name: SmmPeriodicTimerDispatch.h\r
+\r
+ @par Revision Reference:\r
+ This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+ Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+#define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Periodic Timer SMI Protocol\r
+//\r
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \\r
+ { \\r
+ 0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 } \\r
+ }\r
+\r
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Period is the minimum period of time in 100 nanosecond units that child gets called.\r
+// The child will be called back after a time greater than the time Period.\r
+//\r
+// SmiTickInterval is the period of time interval between SMIs. Children of this interface\r
+// should use this field when registering for periodic timer intervals when a finer\r
+// granularity periodic SMI is desired. Valid values for this field are those returned\r
+// by GetNextInterval. A value of 0 indicates the parent is allowed to use any SMI\r
+// interval period to satisfy the requested period.\r
+// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.\r
+// A child wishes schedule a period SMI to fire on a period of 3 seconds, there\r
+// are several ways to approach the problem:\r
+// 1. The child may accept a 4 second periodic rate, in which case it registers with\r
+// Period = 40000\r
+// SmiTickInterval = 20000\r
+// The resulting SMI will occur every 2 seconds with the child called back on\r
+// every 2nd SMI.\r
+// NOTE: the same result would occur if the child set SmiTickInterval = 0.\r
+// 2. The child may choose the finer granularity SMI (64ms):\r
+// Period = 30000\r
+// SmiTickInterval = 640\r
+// The resulting SMI will occur every 64ms with the child called back on\r
+// every 47th SMI.\r
+// NOTE: the child driver should be aware that this will result in more\r
+// SMIs occuring during system runtime which can negatively impact system\r
+// performance.\r
+//\r
+// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a\r
+// value of 0 indicates an unknown amount of time.\r
+//\r
+typedef struct {\r
+ UINT64 Period;\r
+ UINT64 SmiTickInterval;\r
+ UINT64 ElapsedTime;\r
+} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+ Dispatch function for a Periodic Timer SMI handler.\r
+\r
+ @param DispatchHandle Handle of this dispatch function.\r
+ @param DispatchContext Pointer to the dispatch function's context.\r
+ The DispatchContext fields are filled in\r
+ by the dispatching driver prior to\r
+ invoking this dispatch function.\r
+\r
+ Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (\r
+ IN EFI_HANDLE DispatchHandle,\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext\r
+ );\r
+\r
+/**\r
+ Returns the next SMI tick period supported by the chipset. The order\r
+ returned is from longest to shortest interval period.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param SmiTickInterval Pointer to pointer of next shorter SMI interval\r
+ period supported by the child. This parameter works as a get-first,\r
+ get-next field.The first time this function is called, *SmiTickInterval\r
+ should be set to NULL to get the longest SMI interval.The returned\r
+ *SmiTickInterval should be passed in on subsequent calls to get the\r
+ next shorter interval period until *SmiTickInterval = NULL.\r
+\r
+ @retval EFI_SUCCESS The service returned successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
+ IN OUT UINT64 **SmiTickInterval\r
+ );\r
+\r
+/**\r
+ Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+ @param This Protocol instance pointer.\r
+ @param DispatchFunction Pointer to dispatch function to be invoked for\r
+ this SMI source\r
+ @param DispatchContext Pointer to the dispatch function's context.\r
+ The caller fills this context in before calling\r
+ the register function to indicate to the register\r
+ function the period at which the dispatch function\r
+ should be invoked.\r
+ @param DispatchHandle Handle of dispatch function, for when interfacing\r
+ with the parent Sx state SMM driver.\r
+\r
+ @retval EFI_SUCCESS The dispatch function has been successfully\r
+ registered and the SMI source has been enabled.\r
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+ @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+ child.\r
+ @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value\r
+ is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext,\r
+ OUT EFI_HANDLE *DispatchHandle\r
+ );\r
+\r
+/**\r
+ Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+ @param This Protocol instance pointer.\r
+ @param DispatchHandle Handle of dispatch function to deregister.\r
+\r
+ @retval EFI_SUCCESS The dispatch function has been successfully\r
+ unregistered and the SMI source has been disabled\r
+ if there are no other registered child dispatch\r
+ functions for this SMI source.\r
+ @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (\r
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,\r
+ IN EFI_HANDLE DispatchHandle\r
+ );\r
+\r
+//\r
+// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
+//\r
+/**\r
+ @par Protocol Description:\r
+ Provides the parent dispatch service for the periodical timer SMI source generator.\r
+\r
+ @param Register\r
+ Installs a child service to be dispatched by this protocol.\r
+\r
+ @param UnRegister\r
+ Removes a child service dispatched by this protocol.\r
+\r
+ @param GetNextShorterInterval\r
+ Returns the next SMI tick period that is supported by the chipset. \r
+\r
+**/\r
+struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
+ EFI_SMM_PERIODIC_TIMER_REGISTER Register;\r
+ EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
+ EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
+\r
+#endif\r