summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/ExtendedHiiLib
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-02 13:15:44 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-02 13:15:44 +0000
commit9226efe5ebb83ad0d5882e3eb7a54f3d63f81e9d (patch)
tree9cc9cc6964c6ea0d510c1eceda6ee5e134ed6f84 /MdeModulePkg/Library/ExtendedHiiLib
parente52c5a9fdcc1663f98e1a1090c424c1606990650 (diff)
downloadedk2-9226efe5ebb83ad0d5882e3eb7a54f3d63f81e9d.zip
edk2-9226efe5ebb83ad0d5882e3eb7a54f3d63f81e9d.tar.gz
edk2-9226efe5ebb83ad0d5882e3eb7a54f3d63f81e9d.tar.bz2
1) Cleanup HiiLib, IfrSupportLib.
2) Add ExtendedHiiLib and ExtendedIfrSupportLib which implement APIs that require the OPcode and Device Path which is specific to Intel's implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4662 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/ExtendedHiiLib')
-rw-r--r--MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c116
-rw-r--r--MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf47
-rw-r--r--MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.msa45
3 files changed, 208 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c
new file mode 100644
index 0000000..22b9763
--- /dev/null
+++ b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c
@@ -0,0 +1,116 @@
+/** @file
+ HII Library implementation that uses DXE protocols and services.
+
+ Copyright (c) 2006, Intel Corporation<BR>
+ 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.
+
+**/
+
+
+#include <PiDxe.h>
+
+#include <Protocol/DevicePath.h>
+
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <MdeModuleHii.h>
+
+
+//
+// Hii vendor device path template
+//
+HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = {
+ {
+ {
+ {
+ HARDWARE_DEVICE_PATH,
+ HW_VENDOR_DP,
+ {
+ (UINT8) (sizeof (HII_VENDOR_DEVICE_PATH_NODE)),
+ (UINT8) ((sizeof (HII_VENDOR_DEVICE_PATH_NODE)) >> 8)
+ }
+ },
+ EFI_IFR_TIANO_GUID
+ },
+ 0
+ },
+ {
+ END_DEVICE_PATH_TYPE,
+ END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ {
+ END_DEVICE_PATH_LENGTH
+ }
+ }
+};
+
+
+EFI_STATUS
+EFIAPI
+HiiLibCreateHiiDriverHandle (
+ OUT EFI_HANDLE *DriverHandle
+ )
+{
+ EFI_STATUS Status;
+ HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath;
+ UINT64 MonotonicCount;
+
+ VendorDevicePath = AllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);
+ if (VendorDevicePath == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ gBS->GetNextMonotonicCount (&MonotonicCount);
+ VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;
+
+ *DriverHandle = NULL;
+ Status = gBS->InstallProtocolInterface (
+ DriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ VendorDevicePath
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+VOID
+EFIAPI
+HiiLibDestroyHiiDriverHandle (
+ IN EFI_HANDLE DriverHandle
+ )
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+
+ Status = gBS->HandleProtocol (
+ DriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &DevicePath
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->UninstallProtocolInterface (
+ DriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ DevicePath
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ FreePool (DevicePath);
+
+}
+
+
+
diff --git a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf
new file mode 100644
index 0000000..f7b8e34
--- /dev/null
+++ b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf
@@ -0,0 +1,47 @@
+#/** @file
+# Library instance for HII common routines.
+#
+# This library instance implements the common HII routines.
+# Copyright (c) 2006, Intel Corporation
+#
+# 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.
+#
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = ExtendedHiiLib
+ FILE_GUID = 35961516-ABA1-4636-A4C0-608E62BE8BB0
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ExtendedHiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x0002000A
+
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ ExtendedHiiLib.c
+
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+ MemoryAllocationLib
+ DebugLib
+ PcdLib
+ UefiRuntimeServicesTableLib
+
+[Protocols]
+ gEfiDevicePathProtocolGuid
+
diff --git a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.msa b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.msa
new file mode 100644
index 0000000..feedd21
--- /dev/null
+++ b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.msa
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <MsaHeader>
+ <ModuleName>HiiLib</ModuleName>
+ <ModuleType>DXE_DRIVER</ModuleType>
+ <GuidValue>3143687A-7C80-404e-B5FE-2D88980E1B1C</GuidValue>
+ <Version>1.0</Version>
+ <Abstract>Library instance for HII common routines.</Abstract>
+ <Description>This library instance implements the common HII routines.</Description>
+ <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
+ <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>
+ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
+ </MsaHeader>
+ <ModuleDefinitions>
+ <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <BinaryModule>false</BinaryModule>
+ <OutputFileBasename>HiiLib</OutputFileBasename>
+ </ModuleDefinitions>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">
+ <Keyword>HiiLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>DebugLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>MemoryAllocationLib</Keyword>
+ </LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>HiiLib.c</Filename>
+ </SourceFiles>
+ <PackageDependencies>
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ </PackageDependencies>
+ <Externs>
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
+ </Externs>
+</ModuleSurfaceArea> \ No newline at end of file