]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add definition for UEFI25 HII Config keyword handler protocol.
authorEric Dong <eric.dong@intel.com>
Wed, 13 May 2015 08:33:20 +0000 (08:33 +0000)
committerydong10 <ydong10@Edk2>
Wed, 13 May 2015 08:33:20 +0000 (08:33 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17427 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/HiiConfigKeyword.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/HiiConfigKeyword.h b/MdePkg/Include/Protocol/HiiConfigKeyword.h
new file mode 100644 (file)
index 0000000..f8fe192
--- /dev/null
@@ -0,0 +1,199 @@
+/** @file\r
+  The file provides the mechanism to set and get the values \r
+  associated with a keyword exposed through a x-UEFI- prefixed \r
+  configuration language namespace.\r
+  \r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+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
+**/\r
+\r
+#ifndef __EFI_CONFIG_KEYWORD_HANDLER_H__\r
+#define __EFI_CONFIG_KEYWORD_HANDLER_H__\r
+\r
+#define EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL_GUID \\r
+{ \\r
+  0x0a8badd5, 0x03b8, 0x4d19, {0xb1, 0x28, 0x7b, 0x8f, 0x0e, 0xda, 0xa5, 0x96 } \\r
+}\r
+\r
+//***********************************************************\r
+// Progress Errors\r
+//***********************************************************\r
+#define KEYWORD_HANDLER_NO_ERROR                       0x00000000\r
+#define KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND         0x00000001\r
+#define KEYWORD_HANDLER_MALFORMED_STRING               0x00000002\r
+#define KEYWORD_HANDLER_KEYWORD_NOT_FOUND              0x00000004\r
+#define KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED    0x00000008\r
+#define KEYWORD_HANDLER_ACCESS_NOT_PERMITTED           0x00000010\r
+#define KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR     0x80000000\r
+\r
+typedef struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL;\r
+\r
+/**\r
+\r
+  This function accepts a <MultiKeywordResp> formatted string, finds the associated\r
+  keyword owners, creates a <MultiConfigResp> string from it and forwards it to the\r
+  EFI_HII_ROUTING_PROTOCOL.RouteConfig function.\r
+  \r
+  If there is an issue in resolving the contents of the KeywordString, then the \r
+  function returns an error and also sets the Progress and ProgressErr with the \r
+  appropriate information about where the issue occurred and additional data about\r
+  the nature of the issue. \r
+  \r
+  In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND\r
+  error is generated during processing the second or later keyword element, the system\r
+  storage associated with earlier keywords is not modified. All elements of the \r
+  KeywordString must successfully pass all tests for format and access prior to making\r
+  any modifications to storage.\r
+  \r
+  In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString\r
+  containing multiple keywords, the state of storage associated with earlier keywords\r
+  is undefined.\r
+\r
+\r
+  @param This             Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
+\r
+  @param KeywordString    A null-terminated string in <MultiKeywordResp> format. \r
+\r
+  @param Progress         On return, points to a character in the KeywordString. \r
+                          Points to the string's NULL terminator if the request \r
+                          was successful. Points to the most recent '&' before \r
+                          the first failing string element if the request was \r
+                          not successful.\r
+\r
+  @param ProgressErr      If during the processing of the KeywordString there was\r
+                          a failure, this parameter gives additional information \r
+                          about the possible source of the problem. The various \r
+                          errors are defined in "Related Definitions" below.\r
+\r
+\r
+  @retval EFI_SUCCESS             The specified action was completed successfully.\r
+\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  1. KeywordString is NULL.\r
+                                  2. Parsing of the KeywordString resulted in an \r
+                                     error. See Progress and ProgressErr for more data.\r
+\r
+  @retval EFI_NOT_FOUND           An element of the KeywordString was not found. \r
+                                  See ProgressErr for more data.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.  \r
+                                  See ProgressErr for more data.\r
+                                  \r
+  @retval EFI_ACCESS_DENIED       The action violated system policy. See ProgressErr \r
+                                  for more data.\r
+\r
+  @retval EFI_DEVICE_ERROR        An unexpected system error occurred. See ProgressErr\r
+                                  for more data.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_SET_DATA) (\r
+  IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
+  IN CONST EFI_STRING                    KeywordString,\r
+  OUT EFI_STRING                         *Progress,\r
+  OUT UINT32                             *ProgressErr\r
+  );\r
+\r
+\r
+/**\r
+\r
+  This function accepts a <MultiKeywordRequest> formatted string, finds the underlying \r
+  keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the\r
+  EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.\r
+  \r
+  If there is an issue in resolving the contents of the KeywordString, then the function\r
+  returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the\r
+  appropriate information about where the issue occurred and additional data about the\r
+  nature of the issue.\r
+  \r
+  In the case when KeywordString is NULL, or contains multiple keywords, or when\r
+  EFI_NOT_FOUND is generated while processing the keyword elements, the Results string\r
+  contains values returned for all keywords processed prior to the keyword generating the \r
+  error but no values for the keyword with error or any following keywords.\r
+\r
+  \r
+  @param This           Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
+  \r
+  @param NameSpaceId    A null-terminated string containing the platform configuration\r
+                        language to search through in the system. If a NULL is passed\r
+                        in, then it is assumed that any platform configuration language\r
+                        with the prefix of "x-UEFI-" are searched.\r
+                        \r
+  @param KeywordString  A null-terminated string in <MultiKeywordRequest> format. If a\r
+                        NULL is passed in the KeywordString field, all of the known \r
+                        keywords in the system for the NameSpaceId specified are \r
+                        returned in the Results field.\r
+  \r
+  @param Progress       On return, points to a character in the KeywordString. Points\r
+                        to the string's NULL terminator if the request was successful. \r
+                        Points to the most recent '&' before the first failing string\r
+                        element if the request was not successful.\r
+                        \r
+  @param ProgressErr    If during the processing of the KeywordString there was a\r
+                        failure, this parameter gives additional information about the \r
+                        possible source of the problem. See the definitions in SetData()\r
+                        for valid value definitions.\r
+  \r
+  @param Results        A null-terminated string in <MultiKeywordResp> format is returned\r
+                        which has all the values filled in for the keywords in the \r
+                        KeywordString. This is a callee-allocated field, and must be freed\r
+                        by the caller after being used. \r
+\r
+  @retval EFI_SUCCESS             The specified action was completed successfully.\r
+  \r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  1.Progress, ProgressErr, or Resuts is NULL.\r
+                                  2.Parsing of the KeywordString resulted in an error. See\r
+                                    Progress and ProgressErr for more data.\r
+  \r
+\r
+  @retval EFI_NOT_FOUND           An element of the KeywordString was not found. See\r
+                                  ProgressErr for more data.\r
+\r
+  @retval EFI_NOT_FOUND           The NamespaceId specified was not found.  See ProgressErr\r
+                                  for more data.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.  See\r
+                                  ProgressErr for more data.\r
+                                  \r
+  @retval EFI_ACCESS_DENIED       The action violated system policy.  See ProgressErr for\r
+                                  more data.\r
+\r
+  @retval EFI_DEVICE_ERROR        An unexpected system error occurred.  See ProgressErr\r
+                                  for more data.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_GET_DATA) (\r
+  IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL  *This,\r
+  IN CONST EFI_STRING                     NameSpaceId, OPTIONAL\r
+  IN CONST EFI_STRING                     KeywordString, OPTIONAL\r
+  OUT EFI_STRING                          *Progress, \r
+  OUT UINT32                              *ProgressErr,\r
+  OUT EFI_STRING                          *Results\r
+  );\r
+\r
+///\r
+/// The EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL provides the mechanism \r
+/// to set and get the values associated with a keyword exposed \r
+/// through a x-UEFI- prefixed configuration language namespace\r
+///\r
+\r
+struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL {\r
+  EFI_CONFIG_KEYWORD_HANDLER_SET_DATA  SetData;\r
+  EFI_CONFIG_KEYWORD_HANDLER_GET_DATA  GetData;\r
+};\r
+\r
+extern EFI_GUID gEfiConfigKeywordHandlerProtocolGuid;\r
+\r
+#endif\r
+\r
index fbcf4017d85988d7d77e0af709d2e423220148b3..a9bbc3d131476a80212665e32bfd354f48b9645e 100644 (file)
   ## Include/Protocol/BootManagerPolicy.h\r
   gEfiBootManagerPolicyProtocolGuid    = { 0xfedf8e0c, 0xe147, 0x11e3, { 0x99, 0x03, 0xb8, 0xe8, 0x56, 0x2c, 0xba, 0xfa }}\r
 \r
+  ## Include/Protocol/HiiConfigKeyword.h \r
+  gEfiConfigKeywordHandlerProtocolGuid = {0x0a8badd5, 0x03b8, 0x4d19, {0xb1, 0x28, 0x7b, 0x8f, 0x0e, 0xda, 0xa5, 0x96}} \r
+\r
 #\r
 # [Error.gEfiMdePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r