]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add in Intel Framework HiiLib class and instance.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Jun 2007 01:46:13 +0000 (01:46 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Jun 2007 01:46:13 +0000 (01:46 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2760 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkPkg/Include/Library/HiiLib.h [new file with mode: 0644]
IntelFrameworkPkg/Library/HiiLib/CommonHeader.h [new file with mode: 0644]
IntelFrameworkPkg/Library/HiiLib/HiiLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/HiiLib/HiiLib.inf [new file with mode: 0644]
IntelFrameworkPkg/Library/HiiLib/HiiLib.msa [new file with mode: 0644]

diff --git a/IntelFrameworkPkg/Include/Library/HiiLib.h b/IntelFrameworkPkg/Include/Library/HiiLib.h
new file mode 100644 (file)
index 0000000..51fde14
--- /dev/null
@@ -0,0 +1,44 @@
+/** @file\r
+  Public include file for the HII Library\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:  HiiLib.h\r
+\r
+**/\r
+\r
+#ifndef __HII_LIB_H__\r
+#define __HII_LIB_H__\r
+\r
+/**\r
+  This function allocates pool for an EFI_HII_PACKAGES structure\r
+  with enough space for the variable argument list of package pointers.\r
+  The allocated structure is initialized using NumberOfPackages, Guid, \r
+  and the variable length argument list of package pointers.\r
+\r
+  @param  NumberOfPackages The number of HII packages to prepare.\r
+  @param  Guid Package GUID.\r
+\r
+  @return\r
+  The allocated and initialized packages.\r
+\r
+**/\r
+EFI_HII_PACKAGES *\r
+EFIAPI\r
+PreparePackages (\r
+  IN UINTN           NumberOfPackages,\r
+  IN CONST EFI_GUID  *Guid OPTIONAL,\r
+  ...\r
+  )\r
+;\r
+\r
+\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/HiiLib/CommonHeader.h b/IntelFrameworkPkg/Library/HiiLib/CommonHeader.h
new file mode 100644 (file)
index 0000000..7b3891c
--- /dev/null
@@ -0,0 +1,33 @@
+/**@file\r
+  Common header file shared by all source files.\r
+\r
+  This file includes package header files, library classes and protocol, PPI & GUID definitions.\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
+   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
+#ifndef __COMMON_HEADER_H_\r
+#define __COMMON_HEADER_H_\r
+\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/HiiLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/HiiLib/HiiLib.c b/IntelFrameworkPkg/Library/HiiLib/HiiLib.c
new file mode 100644 (file)
index 0000000..3b0876c
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  HII Library implementation that uses DXE protocols and services.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\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:  HiiLib.c\r
+\r
+**/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "CommonHeader.h"\r
+\r
+/**\r
+  This function allocates pool for an EFI_HII_PACKAGES structure\r
+  with enough space for the variable argument list of package pointers.\r
+  The allocated structure is initialized using NumberOfPackages, Guid, \r
+  and the variable length argument list of package pointers.\r
+\r
+  @param  NumberOfPackages The number of HII packages to prepare.\r
+  @param  Guid Package GUID.\r
+\r
+  @return The allocated and initialized packages.\r
+\r
+**/\r
+EFI_HII_PACKAGES *\r
+EFIAPI\r
+PreparePackages (\r
+  IN UINTN           NumberOfPackages,\r
+  IN CONST EFI_GUID  *Guid OPTIONAL,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST           Args;\r
+  EFI_HII_PACKAGES  *HiiPackages;\r
+  VOID              **Package;\r
+  UINTN             Index;\r
+\r
+  ASSERT (NumberOfPackages > 0);\r
+\r
+  HiiPackages                   = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));\r
+  ASSERT (HiiPackages != NULL);\r
+\r
+  HiiPackages->GuidId           = (EFI_GUID *) Guid;\r
+  HiiPackages->NumberOfPackages = NumberOfPackages;\r
+  Package                       = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));\r
+\r
+  VA_START (Args, Guid);\r
+\r
+  for (Index = 0; Index < NumberOfPackages; Index++) {\r
+    *Package = VA_ARG (Args, VOID *);\r
+    Package++;\r
+  }\r
+\r
+  VA_END (Args);\r
+\r
+  return HiiPackages;\r
+\r
+}\r
diff --git a/IntelFrameworkPkg/Library/HiiLib/HiiLib.inf b/IntelFrameworkPkg/Library/HiiLib/HiiLib.inf
new file mode 100644 (file)
index 0000000..80ec9ff
--- /dev/null
@@ -0,0 +1,70 @@
+#/** @file\r
+# Library instance for HII common routines.\r
+#\r
+# This library instance implements the common HII routines.\r
+# Copyright (c) 2006, Intel Corporation\r
+#\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
+#  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
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = HiiLib\r
+  FILE_GUID                      = 1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+  HiiLib.c\r
+  CommonHeader.h\r
+\r
+\r
+################################################################################\r
+#\r
+# Includes Section - list of Include locations that are required for\r
+#                    this module.\r
+#\r
+################################################################################\r
+\r
+[Includes]\r
+  $(WORKSPACE)/MdePkg/Include/Library\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+#                         this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+  MemoryAllocationLib\r
+  DebugLib\r
+\r
diff --git a/IntelFrameworkPkg/Library/HiiLib/HiiLib.msa b/IntelFrameworkPkg/Library/HiiLib/HiiLib.msa
new file mode 100644 (file)
index 0000000..d3eac8f
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>HiiLib</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Library instance for HII common routines.</Abstract>\r
+    <Description>This library instance implements the common HII routines.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>HiiLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>HiiLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>HiiLib.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file