]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for the following drivers and librarys.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 4 Jan 2009 03:20:55 +0000 (03:20 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 4 Jan 2009 03:20:55 +0000 (03:20 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7172 6f19259b-4bc3-4df7-8a09-765794883524

23 files changed:
MdeModulePkg/Application/HelloWorld/HelloWorld.c
MdeModulePkg/Application/HelloWorld/HelloWorld.inf
MdeModulePkg/Include/Guid/CapsuleVendor.h
MdeModulePkg/Include/Library/CapsuleLib.h
MdeModulePkg/Include/Library/RecoveryLib.h
MdeModulePkg/Include/Library/S3Lib.h
MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c
MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.c
MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.c
MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h [deleted file]
MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf
MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.h [deleted file]
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

index 5ffddfb481ce74290584ea32bc9aa3df15510839..19e5791fa8ebe718a7148d210997bea4223bc417 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-  This simple application just print a "UEFI Hello World!" to the UEFI Console.\r
-  \r
-  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
+  This sample application bases on HelloWorld PCD setting \r
+  to print "UEFI Hello World!" to the UEFI Console.\r
+\r
+  Copyright (c) 2006 - 2008, 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
@@ -20,8 +21,7 @@
 \r
 /**\r
   The user Entry Point for Application. The user code starts with this function\r
-  as the real entry point for the image goes into a library that calls this \r
-  function.\r
+  as the real entry point for the application.\r
 \r
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
   @param[in] SystemTable    A pointer to the EFI System Table.\r
@@ -46,6 +46,9 @@ UefiMain (
   //\r
   if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {\r
        for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {\r
+         //\r
+         // Use UefiLib Print API to print string to UEFI console\r
+         //\r
        Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));\r
     }\r
   }\r
index c284fa4460f40352e5ed6b1ddd06d58cba87ffa3..50fb686319afcd36925e9eae9b38725a82352c42 100644 (file)
@@ -1,8 +1,10 @@
 #/** @file\r
-# Sample UEFI Application Reference Module\r
+#  Sample UEFI Application Reference EDKII Module\r
 #\r
-# This is a shell application that will display Hello World.\r
-# Copyright (c) 2008, Intel Corporation.\r
+#  This is a shell application that will display Hello World.\r
+#  It uses EDKII PCD feature to show PCD usage and configuration.\r
+#\r
+#  Copyright (c) 2008, 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
@@ -20,7 +22,6 @@
   FILE_GUID                      = 6987936E-ED34-44db-AE97-1FA5E4ED2116\r
   MODULE_TYPE                    = UEFI_APPLICATION\r
   VERSION_STRING                 = 1.0\r
-\r
   ENTRY_POINT                    = UefiMain\r
 \r
 #\r
index 5bbccd3652f7706dacab6817ae0634acf41979b1..b326018c49fae48acc233b810cd3fba4b81c3a12 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
 \r
-  This file defines capsule update guid, capsule variable name and \r
-  capsule guid hob data structure, which are required by capsule update feature.\r
+  This file defines capsule vendor guid, capsule variable name \r
+  and capsule guid hob data structure. \r
+  They are used by EDKII implementation of capsule update across a system reset.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -18,9 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define __EFI_CAPSULE_VENDOR_GUID_H__\r
 \r
 ///\r
-/// This guid is used as a variable GUID (depending on implementation)\r
-/// for the capsule variable if the capsule pointer is passes through reset\r
-/// via a variable.\r
+/// This guid is used as a variable GUID for the capsule variable \r
+/// if the capsule pointer is passed through reset via a variable.\r
+///\r
+/// This guid is also used as a hob GUID for the capsule data \r
+/// when the capsule pointer is passed from PEI phase to DXE phase.\r
 ///\r
 #define EFI_CAPSULE_VENDOR_GUID  \\r
   { 0x711C703F, 0xC285, 0x4B10, { 0xA3, 0xB0, 0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2 } }\r
@@ -30,14 +33,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 /// \r
 #define EFI_CAPSULE_VARIABLE_NAME L"CapsuleUpdateData"\r
 \r
-extern EFI_GUID gEfiCapsuleVendorGuid;\r
-\r
 ///\r
 /// Data structure of capsule guid hob entry\r
 ///\r
 typedef struct {\r
-  EFI_PHYSICAL_ADDRESS BaseAddress;  /// Capsule data start address\r
-  UINT32 Length;                     /// Length of capsule data.\r
+  EFI_PHYSICAL_ADDRESS BaseAddress;  ///> Capsule data start address\r
+  UINT32 Length;                     ///> Length of capsule data.\r
 } CAPSULE_HOB_INFO;\r
 \r
+extern EFI_GUID gEfiCapsuleVendorGuid;\r
+\r
 #endif // #ifndef _EFI_CAPSULE_VENDOR_GUID_H_\r
index 3bbc8c03c43e4f4cc2f2790ca65d8de57a09e191..662e4def951c2653a5939d9ddef00ff187507b3a 100644 (file)
@@ -1,9 +1,8 @@
 /** @file\r
 \r
-  Capsule Library. This library class defines a set of interfaces on \r
-  how to process capusle image update.\r
+  This library class defines a set of interfaces on how to process capusle image update.\r
 \r
-  Copyright (c) 2007, Intel Corporation\r
+  Copyright (c) 2007 - 2008, 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
@@ -18,7 +17,8 @@
 #define __CAPSULE_LIB_H__\r
 \r
 /**\r
-  Those capsules supported by the firmwares.\r
+  The firmware checks whether the capsule image is supported \r
+  by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.\r
   \r
   @param  CapsuleHeader    Point to the UEFI capsule image to be checked.\r
   \r
@@ -32,7 +32,8 @@ SupportCapsuleImage (
   );\r
 \r
 /**\r
-  The firmware implements to process the capsule image.\r
+  The firmware specific implementation processes the capsule image\r
+  if it recognized the format of this capsule image.\r
   \r
   @param  CapsuleHeader    Point to the UEFI capsule image to be processed. \r
    \r
@@ -46,5 +47,3 @@ ProcessCapsuleImage (
   );\r
 \r
 #endif\r
-\r
-\r
index fc0413656de17ff992d78fd568fa8af33a2325df..a724c9ed28d2e3a6b8192062b5624882f240d9ef 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Recovery Library. This library class defines a set of methods related recovery mode.\r
+  Recovery library class defines a set of methods related recovery boot mode.\r
 \r
 Copyright (c) 2005 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define __RECOVERY_LIB_H__\r
 \r
 /**\r
-  Calling this function causes the system do recovery.\r
+  Calling this function causes the system do recovery boot path.\r
   \r
   @retval EFI_SUCESS   Sucess to do recovery.\r
   @retval Others       Fail to do recovery.\r
index 8e2a25d14f9b789f5aee6eb4b9bed866da254602..c8fa22aabac53d275b60684e68ef525462f8e38f 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  S3 Library. This library class defines a set of methods related do S3 mode.\r
+  S3 library class defines a set of methods related do S3 boot mode.\r
 \r
 Copyright (c) 2005 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
index 1d45729eed246f29634774cdf220c0c68db86f4c..d2895778b2b57e766f46d36fabfa22362ff6c763 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Null Dxe Capsule Library instance.\r
+  Null Dxe Capsule Library instance does nothing and returns unsupport status.\r
 \r
 Copyright (c) 2007 - 2008 Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -15,7 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/CapsuleLib.h>\r
 \r
 /**\r
-  Check those capsules are supported by the firmwares.\r
+  The firmware checks whether the capsule image is supported \r
+  by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.\r
   \r
   @param  CapsuleHeader    Point to the UEFI capsule image to be checked.\r
   \r
@@ -31,7 +32,8 @@ SupportCapsuleImage (
 }\r
 \r
 /**\r
-  The firmware implements to process the capsule image.\r
+  The firmware specific implementation processes the capsule image\r
+  if it recognized the format of this capsule image.\r
   \r
   @param  CapsuleHeader    Point to the UEFI capsule image to be processed. \r
    \r
index dd2a95083ea374031633a94e23133e8e3d205e74..1e7a967421a083f9d0dbdd998a59bf8badbbf82f 100644 (file)
@@ -1,5 +1,6 @@
 #/** @file\r
-#  Capsule library NULL instance for DXE_DRIVER, DXE_RUNTIME_DRIVER\r
+#  NULL Dxe Capsule library instance.\r
+#  It can make core modules pass package level build.\r
 #\r
 #  Copyright (c) 2006 - 2008, Intel Corporation.\r
 #\r
index e664428d0e52705e306da840d1c370ad3042e83c..b87af37a91b9de76f1b12713d671d9d6d803609d 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
 \r
-  Implements CRC32 guided section handler to parse CRC32 encapsulation section, \r
-  extract data and authenticate 32 bit CRC value.\r
+  This library registers CRC32 guided section handler \r
+  to parse CRC32 encapsulation section and extract raw data.\r
+  It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.\r
 \r
 Copyright (c) 2007 - 2008, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
@@ -24,15 +25,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define EFI_SECITON_SIZE_MASK 0x00ffffff\r
 \r
+///\r
+/// CRC32 Guided Section header\r
+///\r
 typedef struct {\r
-  EFI_GUID_DEFINED_SECTION  GuidedSectionHeader;\r
-  UINT32                    CRC32Checksum;\r
+  EFI_GUID_DEFINED_SECTION  GuidedSectionHeader; ///< EFI guided section header\r
+  UINT32                    CRC32Checksum;       ///< 32bit CRC check sum\r
 } CRC32_SECTION_HEADER;\r
 \r
 /**\r
 \r
-  The implementation of Crc32 guided section GetInfo() to get \r
-  size and attribute of the guided section.\r
+  GetInfo gets raw data size and attribute of the input guided section.\r
+  It first checks whether the input guid section is supported. \r
+  If not, EFI_INVALID_PARAMETER will return.\r
 \r
   @param InputSection       Buffer containing the input GUIDed section to be processed.\r
   @param OutputBufferSize   The size of OutputBuffer.\r
@@ -74,13 +79,16 @@ Crc32GuidedSectionGetInfo (
 \r
 /**\r
 \r
-  The implementation of Crc32 Guided section extraction to get the section data.\r
+  Extraction handler tries to extract raw data from the input guided section.\r
+  It also does authentication check for 32bit CRC value in the input guided section.\r
+  It first checks whether the input guid section is supported. \r
+  If not, EFI_INVALID_PARAMETER will return.\r
 \r
   @param InputSection    Buffer containing the input GUIDed section to be processed.\r
-  @param OutputBuffer    to contain the output data, which is allocated by the caller.\r
+  @param OutputBuffer    Buffer to contain the output raw data allocated by the caller.\r
   @param ScratchBuffer   A pointer to a caller-allocated buffer for function internal use.\r
   @param AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the\r
-                         authentication status of the output buffer.\r
+                              authentication status of the output buffer.\r
 \r
   @retval EFI_SUCCESS            Section Data and Auth Status is extracted successfully.\r
   @retval EFI_INVALID_PARAMETER  The GUID in InputSection does not match this instance guid.\r
@@ -161,13 +169,13 @@ Crc32GuidedSectionHandler (
 }\r
 \r
 /**\r
-  Register Crc32 section handler.\r
+  Register the handler to extract CRC32 guided section.\r
 \r
   @param  ImageHandle  ImageHandle of the loaded driver.\r
   @param  SystemTable  Pointer to the EFI System Table.\r
 \r
-  @retval  RETURN_SUCCESS            Register successfully.\r
-  @retval  RETURN_OUT_OF_RESOURCES   No enough memory to register this handler.\r
+  @retval  EFI_SUCCESS            Register successfully.\r
+  @retval  EFI_OUT_OF_RESOURCES   No enough memory to register this handler.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
index 360ee66540073ca5a5757a9cc318b1b47ea83590..f13098f8d3035f73b253333a344575d6e4f82d92 100644 (file)
@@ -1,5 +1,8 @@
 #/** @file\r
-# Crc32SectionExtract library instance registers Crc32 handler into ExtractGuidedSectionLib.\r
+#  This library doesn't produce any library class. In its constructor function,\r
+#  it uses ExtractGuidedSectionLib service to registers CRC32 guided section handler\r
+#  that parses CRC32 encapsulation section and extracts raw data.\r
+#  It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.\r
 #\r
 # Copyright (c) 2006 - 2008, Intel Corporation\r
 #\r
@@ -10,7 +13,6 @@
 #  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
 [Defines]\r
@@ -43,6 +45,6 @@
   BaseMemoryLib\r
 \r
 [Protocols]\r
-  gEfiCrc32GuidedSectionExtractionProtocolGuid\r
-  gEfiSecurityPolicyProtocolGuid\r
+  gEfiCrc32GuidedSectionExtractionProtocolGuid     # ALWAYS CONSUMED used as Guid, not protocol service\r
+  gEfiSecurityPolicyProtocolGuid                   # ALWAYS CONSUMED\r
   
\ No newline at end of file
index 40acc57c958727b783868b855389e42b60aeed39..1f60871a662767845ec8edbcb8bc6d0283c1be28 100644 (file)
@@ -1,6 +1,5 @@
 /** @file\r
-  Null Recovery Library instance. \r
-  This library class defines a set of methods related do recovery.\r
+  Null Recovery Library instance does nothing and returns unsupport status.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -13,9 +12,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 #include <PiPei.h>\r
+#include <Library/RecoveryLib.h>\r
 \r
 /**\r
-  Calling this function causes the system do recovery.\r
+  Calling this function causes the system do recovery boot path.\r
   \r
   @retval EFI_UNSUPPORTED       Recovery is not supported.\r
 **/\r
index 041b5a320c00d62b6c38abe04c0bf19ce3596dea..cdfbb49af5c548ffa08ae4915d3552015a0e3212 100644 (file)
@@ -1,6 +1,7 @@
 #/** @file\r
 #  \r
 #  Null Recovery library instance for PEIM module\r
+#  It can make core modules pass package level build.\r
 #  \r
 #  Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 #  All rights reserved. This program and the accompanying materials\r
index 6cceceab086b5be6d68bf0eed29d138b921a43ae..096a6af885ece8196d472673bfbc3d9d63955acf 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  S3 Library. This library class defines a set of methods related do S3 mode\r
+  Null S3 Library instance does nothing and returns unsupport status.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 #include <PiPei.h>\r
+#include <Library/S3Lib.h>\r
 \r
 /**\r
   This function is responsible for calling the S3 resume vector in the ACPI Tables.\r
index b2ba7271d80e9e002d41fd3cdd894829e8eb6215..df99874b38afa58e55855d66ad15438c59d26ceb 100644 (file)
@@ -1,6 +1,7 @@
 #/** @file\r
 #  \r
-#  A NULL instance of S3 Library for PEIM\r
+#  Null S3 library instance for PEIM module\r
+#  It can make core modules pass package level build.\r
 #  \r
 #  Copyright (c) 2006 - 2008, Intel Corporation.\r
 #\r
 #  VALID_ARCHITECTURES           = IA32 X64 IPF EBC (EBC is for build only)\r
 #\r
 \r
-[Sources.common]\r
+[Sources]\r
   PeiS3LibNull.c\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-\r
index c43439447361331ff5d3a0c616cb6b3639cc5ffe..ff183f17a78f28139f654227b5f0fc71f6f64f3f 100644 (file)
 \r
 [PcdsFeatureFlag.common]\r
   ## Indicate whether platform can support update capsule across a system reset\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleRest|FALSE|BOOLEAN|0x0001001d\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE|BOOLEAN|0x0001001d\r
   \r
   ## This feature flag can be used to enable or disable the Pcd PEIM database \r
   #  traverse capability. Disable it can reduce the size of final image generated.\r
index 03d2bf9282fd0066c3efd4634e7a7aa8b2c63d32..5addb491180874d9089a8f7dabeb7c9f42e49cba 100644 (file)
@@ -1,6 +1,9 @@
 #/** @file\r
 #  \r
-#   CapsuleRuntime module provides capsule runtime services\r
+#  Capsule Runtime Drivers produces two UEFI capsule runtime services.\r
+#  (UpdateCapsule, QueryCapsuleCapabilities)\r
+#  It installs the Capsule Architectural Protocol (EDKII definition) to signify \r
+#  the capsule runtime services are ready.\r
 #  \r
 #  Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 #  All rights reserved. This program and the accompanying materials\r
@@ -28,7 +31,6 @@
 #\r
 \r
 [Sources.common]\r
-  CapsuleService.h\r
   CapsuleService.c\r
 \r
 [Packages]\r
   UefiBootServicesTableLib\r
   PcdLib\r
   DebugLib\r
-  UefiRuntimeLib\r
+  UefiRuntimeServicesTableLib\r
   UefiDriverEntryPoint\r
   CapsuleLib\r
+  UefiRuntimeLib\r
 \r
 [Guids]\r
-  gEfiCapsuleVendorGuid                         # SOMETIMES_CONSUMED\r
+  gEfiCapsuleVendorGuid                         # Produce variable L"CapsuleUpdateData" for capsule updated data\r
 \r
 [Protocols]\r
   gEfiCapsuleArchProtocolGuid                   # PROTOCOL ALWAYS_PRODUCED\r
 \r
-[FeaturePcd.common]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleRest\r
+[FeaturePcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset\r
 \r
-[FixedPcd.common]\r
+[FixedPcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule\r
 \r
 [Depex]\r
-  gEfiVariableWriteArchProtocolGuid\r
+  gEfiVariableWriteArchProtocolGuid             # Depends on variable write functionality to produce capsule data variable\r
index dbb9563188b237edc5b06ae0bfb5e73bad7dc2ee..2d5411a607c07a1799e37f09c4407a5d31d42142 100644 (file)
@@ -1,6 +1,8 @@
 /** @file\r
   Capsule Runtime Drivers produces two UEFI capsule runtime services.\r
   (UpdateCapsule, QueryCapsuleCapabilities)\r
+  It installs the Capsule Architectural Protocol (EDKII definition) to signify \r
+  the capsule runtime services are ready.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -13,7 +15,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "CapsuleService.h"\r
+#include <Uefi.h>\r
+\r
+#include <Protocol/Capsule.h>\r
+#include <Guid/CapsuleVendor.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/CapsuleLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiRuntimeLib.h>\r
 \r
 /**\r
   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
@@ -90,7 +103,7 @@ UpdateCapsule (
     //\r
     // Check if the platform supports update capsule across a system reset\r
     //\r
-    if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {\r
+    if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
       return EFI_UNSUPPORTED;\r
     }\r
     //\r
@@ -105,13 +118,13 @@ UpdateCapsule (
       // system reset. Set its value into NV storage to let pre-boot driver to pick it up \r
       // after coming through a system reset.\r
       //\r
-      Status = EfiSetVariable (\r
-                 EFI_CAPSULE_VARIABLE_NAME,\r
-                 &gEfiCapsuleVendorGuid,\r
-                 EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
-                 sizeof (UINTN),\r
-                 (VOID *) &ScatterGatherList\r
-                 );\r
+      Status = gRT->SetVariable (\r
+                     EFI_CAPSULE_VARIABLE_NAME,\r
+                     &gEfiCapsuleVendorGuid,\r
+                     EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
+                     sizeof (UINTN),\r
+                     (VOID *) &ScatterGatherList\r
+                     );\r
       if (Status != EFI_SUCCESS) {\r
         return Status;\r
       }\r
@@ -219,7 +232,7 @@ QueryCapsuleCapabilities (
     //\r
     //Check if the platform supports update capsule across a system reset\r
     //\r
-    if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {\r
+    if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
       return EFI_UNSUPPORTED;\r
     }\r
     *ResetType = EfiResetWarm;\r
@@ -237,7 +250,7 @@ QueryCapsuleCapabilities (
 \r
 /**\r
 \r
-  This code is to install UEFI capsule runtime service.\r
+  This code installs UEFI capsule runtime service.\r
 \r
   @param  ImageHandle    The firmware allocated handle for the EFI image.  \r
   @param  SystemTable    A pointer to the EFI System Table.\r
@@ -258,8 +271,8 @@ CapsuleServiceInitialize (
   //\r
   // Install capsule runtime services into UEFI runtime service tables.\r
   //\r
-  SystemTable->RuntimeServices->UpdateCapsule                    = UpdateCapsule;\r
-  SystemTable->RuntimeServices->QueryCapsuleCapabilities         = QueryCapsuleCapabilities;\r
+  gRT->UpdateCapsule                    = UpdateCapsule;\r
+  gRT->QueryCapsuleCapabilities         = QueryCapsuleCapabilities;\r
 \r
   //\r
   // Install the Capsule Architectural Protocol on a new handle\r
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h
deleted file mode 100644 (file)
index 17aa473..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file\r
-  Include the required header files for Capsule Runtime Service drivers.\r
-\r
-Copyright (c) 2006 - 2008, 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
-**/\r
-\r
-#ifndef  _CAPSULE_RUNTIME_H_\r
-#define  _CAPSULE_RUNTIME_H_\r
-\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Protocol/Capsule.h>\r
-#include <Guid/CapsuleVendor.h>\r
-\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/CapsuleLib.h>\r
-\r
-/**\r
-  Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
-  consumption, the firmware may process the capsule immediately. If the payload should persist\r
-  across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
-  be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r
-  part of the reset process.\r
-\r
-  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
-                                being passed into update capsule.\r
-  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
-                                CaspuleHeaderArray.\r
-  @param  ScatterGatherList     Physical pointer to a set of\r
-                                EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
-                                location in physical memory of a set of capsules.\r
-\r
-  @retval EFI_SUCCESS           Valid capsule was passed. If\r
-                                CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
-                                capsule has been successfully processed by the firmware.\r
-  @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.\r
-  @retval EFI_INVALID_PARAMETER CapsuleCount is Zero, or CapsuleImage is not valid.\r
-                                For across reset capsule image, ScatterGatherList is NULL.\r
-  @retval EFI_UNSUPPORTED       CapsuleImage is not recognized by the firmware.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UpdateCapsule(\r
-  IN EFI_CAPSULE_HEADER      **CapsuleHeaderArray,\r
-  IN UINTN                   CapsuleCount,\r
-  IN EFI_PHYSICAL_ADDRESS    ScatterGatherList OPTIONAL\r
-  );\r
-\r
-/**\r
-  Returns if the capsule can be supported via UpdateCapsule().\r
-\r
-  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
-                                being passed into update capsule.\r
-  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
-                                CaspuleHeaderArray.\r
-  @param  MaxiumCapsuleSize     On output the maximum size that UpdateCapsule() can\r
-                                support as an argument to UpdateCapsule() via\r
-                                CapsuleHeaderArray and ScatterGatherList.\r
-  @param  ResetType             Returns the type of reset required for the capsule update.\r
-\r
-  @retval EFI_SUCCESS           Valid answer returned.\r
-  @retval EFI_UNSUPPORTED       The capsule image is not supported on this platform, and\r
-                                MaximumCapsuleSize and ResetType are undefined.\r
-  @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL, or ResetTyep is NULL,\r
-                                Or CapsuleCount is Zero, or CapsuleImage is not valid.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-QueryCapsuleCapabilities(\r
-  IN  EFI_CAPSULE_HEADER   **CapsuleHeaderArray,\r
-  IN  UINTN                CapsuleCount,\r
-  OUT UINT64               *MaxiumCapsuleSize,\r
-  OUT EFI_RESET_TYPE       *ResetType\r
-  );\r
-\r
-#endif\r
-\r
index e46a1c32c8a82efa783bcd9421351f18ccab4075..2a78525785316b7003d7afefc9e0bb89aeaf5c13 100644 (file)
@@ -1,8 +1,9 @@
 #/** @file\r
-#  Single Segment Pci Configuration PPI\r
+#  This driver installs Single Segment Pci Configuration 2 PPI \r
+#  to provide read, write and modify access to Pci configuration space in PEI phase. \r
+#  To follow PI specification, these services also support access to the unaligned Pci address.\r
 #\r
-#  This file declares PciCfg PPI used to access PCI configuration space in PEI\r
-#  Copyright (c) 2006 - 2007, Intel Corporation\r
+#  Copyright (c) 2006 - 2008, 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
@@ -21,6 +22,7 @@
   MODULE_TYPE                    = PEIM\r
   VERSION_STRING                 = 1.0\r
   ENTRY_POINT                    = PeimInitializePciCfg\r
+  PI_SPECIFICATION_VERSION       = 0x00010000\r
 \r
 #\r
 # The following information is for reference only and not required by the build tools.\r
index fdd67f7abb86b66483fca1a04631ea4c1e8b20e9..d2ca19c7b065156f2ad3c5c909d8ba37908188f3 100644 (file)
@@ -1,7 +1,9 @@
 /** @file\r
-  Installs Single Segment Pci Configuration PPI.\r
+  This driver installs Single Segment Pci Configuration 2 PPI \r
+  to provide read, write and modify access to Pci configuration space in PEI phase. \r
+  To follow PI specification, these services also support access to the unaligned Pci address.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation\r
+  Copyright (c) 2006 - 2008, 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
 **/\r
 \r
 #include <PiPei.h>\r
-\r
 #include <Ppi/PciCfg2.h>\r
-\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PciLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
-\r
 #include <IndustryStandard/Pci.h>\r
 \r
-/**\r
-  Reads from a given location in the PCI configuration space.\r
-\r
-  @param  PeiServices     An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
-\r
-  @param  This            Pointer to local data for the interface.\r
-\r
-  @param  Width           The width of the access. Enumerated in bytes.\r
-                          See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
-\r
-  @param  Address         The physical address of the access. The format of\r
-                          the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
-\r
-  @param  Buffer          A pointer to the buffer of data..\r
-\r
-\r
-  @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting the operation at this\r
-                                time.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PciCfg2Read (\r
-  IN CONST  EFI_PEI_SERVICES          **PeiServices,\r
-  IN CONST  EFI_PEI_PCI_CFG2_PPI      *This,\r
-  IN        EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
-  IN        UINT64                    Address,\r
-  IN OUT    VOID                      *Buffer\r
-  );\r
-\r
-/**\r
-  Write to a given location in the PCI configuration space.\r
-\r
-  @param  PeiServices     An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
-\r
-  @param  This            Pointer to local data for the interface.\r
-\r
-  @param  Width           The width of the access. Enumerated in bytes.\r
-                          See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
-\r
-  @param  Address         The physical address of the access. The format of\r
-                          the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
-\r
-  @param  Buffer          A pointer to the buffer of data..\r
-\r
-\r
-  @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting the operation at this\r
-                                time.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PciCfg2Write (\r
-  IN CONST  EFI_PEI_SERVICES          **PeiServices,\r
-  IN CONST  EFI_PEI_PCI_CFG2_PPI      *This,\r
-  IN        EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
-  IN        UINT64                    Address,\r
-  IN OUT    VOID                      *Buffer\r
-  );\r
-\r
-\r
-/**\r
-  PCI read-modify-write operation.\r
-\r
-  @param  PeiServices     An indirect pointer to the PEI Services Table\r
-                          published by the PEI Foundation.\r
-\r
-  @param  This            Pointer to local data for the interface.\r
-\r
-  @param  Width           The width of the access. Enumerated in bytes. Type\r
-                          EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r
-\r
-  @param  Address         The physical address of the access.\r
-\r
-  @param  SetBits         Points to value to bitwise-OR with the read configuration value.\r
-\r
-                          The size of the value is determined by Width.\r
-\r
-  @param  ClearBits       Points to the value to negate and bitwise-AND with the read configuration value.\r
-                          The size of the value is determined by Width.\r
-\r
-\r
-  @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting\r
-                                the operation at this time.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PciCfg2Modify (\r
-  IN CONST  EFI_PEI_SERVICES          **PeiServices,\r
-  IN CONST  EFI_PEI_PCI_CFG2_PPI      *This,\r
-  IN        EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
-  IN        UINT64                    Address,\r
-  IN        VOID                      *SetBits,\r
-  IN        VOID                      *ClearBits\r
-  );\r
-\r
-\r
-\r
-/**\r
-  @par Ppi Description:\r
-  The EFI_PEI_PCI_CFG2_PPI interfaces are used to abstract\r
-  accesses to PCI controllers behind a PCI root bridge\r
-  controller.\r
-\r
-  @param Read     PCI read services.  See the Read() function description.\r
-\r
-  @param Write    PCI write services.  See the Write() function description.\r
-\r
-  @param Modify   PCI read-modify-write services.  See the Modify() function description.\r
-\r
-  @param Segment  The PCI bus segment which the specified functions will access.\r
-\r
-**/\r
-GLOBAL_REMOVE_IF_UNREFERENCED\r
-EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {\r
-  PciCfg2Read,\r
-  PciCfg2Write,\r
-  PciCfg2Modify\r
-};\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED\r
-EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPciCfg2PpiGuid,\r
-  &gPciCfg2Ppi\r
-};\r
-\r
-\r
 /**\r
    Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.\r
 \r
-   @param Address   PCI address with\r
-                    EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
+   @param Address   PCI address with EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.\r
 \r
-   @return The PCI address with PCI_LIB_ADDRESS format.\r
+   @return PCI address with PCI_LIB_ADDRESS format.\r
 \r
 **/\r
 UINTN\r
@@ -185,30 +42,20 @@ PciCfgAddressConvert (
   return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);\r
 }\r
 \r
-\r
 /**\r
   Reads from a given location in the PCI configuration space.\r
 \r
   @param  PeiServices     An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
-\r
   @param  This            Pointer to local data for the interface.\r
-\r
   @param  Width           The width of the access. Enumerated in bytes.\r
                           See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
-\r
   @param  Address         The physical address of the access. The format of\r
                           the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
-\r
-  @param  Buffer          A pointer to the buffer of data..\r
-\r
+  @param  Buffer          A pointer to the buffer of data.\r
 \r
   @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting the operation at this\r
-                                time.\r
-\r
+  @retval EFI_INVALID_PARAMETER The invalid access width.\r
+  \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -271,24 +118,15 @@ PciCfg2Read (
   Write to a given location in the PCI configuration space.\r
 \r
   @param  PeiServices     An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
-\r
   @param  This            Pointer to local data for the interface.\r
-\r
   @param  Width           The width of the access. Enumerated in bytes.\r
                           See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
-\r
   @param  Address         The physical address of the access. The format of\r
                           the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
-\r
-  @param  Buffer          A pointer to the buffer of data..\r
-\r
+  @param  Buffer          A pointer to the buffer of data.\r
 \r
   @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting the operation at this\r
-                                time.\r
+  @retval EFI_INVALID_PARAMETER The invalid access width.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -350,32 +188,22 @@ PciCfg2Write (
 \r
 \r
 /**\r
-  PCI read-modify-write operation.\r
+  This function performs a read-modify-write operation on the contents from a given\r
+  location in the PCI configuration space.\r
 \r
   @param  PeiServices     An indirect pointer to the PEI Services Table\r
                           published by the PEI Foundation.\r
-\r
   @param  This            Pointer to local data for the interface.\r
-\r
   @param  Width           The width of the access. Enumerated in bytes. Type\r
                           EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r
-\r
   @param  Address         The physical address of the access.\r
-\r
   @param  SetBits         Points to value to bitwise-OR with the read configuration value.\r
-\r
                           The size of the value is determined by Width.\r
-\r
   @param  ClearBits       Points to the value to negate and bitwise-AND with the read configuration value.\r
                           The size of the value is determined by Width.\r
 \r
-\r
   @retval EFI_SUCCESS           The function completed successfully.\r
-\r
-  @retval EFI_DEVICE_ERROR      There was a problem with the transaction.\r
-\r
-  @retval EFI_DEVICE_NOT_READY  The device is not capable of supporting\r
-                                the operation at this time.\r
+  @retval EFI_INVALID_PARAMETER The invalid access width.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -445,9 +273,23 @@ PciCfg2Modify (
   } else {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
+EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {\r
+  PciCfg2Read,\r
+  PciCfg2Write,\r
+  PciCfg2Modify,\r
+  0\r
+};\r
+\r
+EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPciCfg2PpiGuid,\r
+  &gPciCfg2Ppi\r
+};\r
+\r
 /**\r
   Module's entry function. \r
   This routine will install EFI_PEI_PCI_CFG2_PPI.\r
@@ -466,10 +308,10 @@ PeimInitializePciCfg (
 {\r
   EFI_STATUS            Status;\r
 \r
-  ASSERT ((**PeiServices).Hdr.Revision >= PEI_SERVICES_REVISION);\r
+  ASSERT ((**PeiServices).Hdr.Revision >= PI_SPECIFICATION_VERSION);\r
 \r
   (**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi;\r
-  Status = (**PeiServices).InstallPpi ((CONST EFI_PEI_SERVICES **)PeiServices, &gPciCfg2PpiList);\r
+  Status = (**PeiServices).InstallPpi (PeiServices, &gPciCfg2PpiList);\r
 \r
   return Status;\r
 }\r
index aa86fdf3010d88d824a87e7e1aa3df778379a8ab..ac3ab297abd44879212b9eb8f0bcd6ce1c8e3c73 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  This driver implements one sample platform security service, which does \r
+  This driver implements a sample platform security service, which does \r
   nothing and always return EFI_SUCCESS.\r
   \r
   Copyright (c) 2006 - 2008, Intel Corporation                                              \r
 **/\r
 \r
 \r
-#include "SecurityStub.h"\r
+#include <Uefi.h>\r
+#include <Protocol/Security.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
 \r
 //\r
 // Handle for the Security Architectural Protocol instance produced by this driver\r
 //\r
 EFI_HANDLE                  mSecurityArchProtocolHandle = NULL;\r
 \r
-//\r
-// Security Architectural Protocol instance produced by this driver\r
-//\r
-EFI_SECURITY_ARCH_PROTOCOL  mSecurityStub = { \r
-  SecurityStubAuthenticateState \r
-};\r
-\r
-\r
 /**\r
   The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific \r
   policy from the DXE core response to an attempt to use a file that returns a \r
@@ -61,7 +57,7 @@ EFI_SECURITY_ARCH_PROTOCOL  mSecurityStub = {
   @param  File             This is a pointer to the device path of the file that is\r
                            being dispatched. This will optionally be used for logging.\r
 \r
-  @retval EFI_SUCCESS            Do nothing and return.\r
+  @retval EFI_SUCCESS            Do nothing and return success.\r
   @retval EFI_INVALID_PARAMETER  File is NULL.\r
 **/\r
 EFI_STATUS\r
@@ -79,14 +75,18 @@ SecurityStubAuthenticateState (
   return EFI_SUCCESS;\r
 }\r
 \r
+//\r
+// Security Architectural Protocol instance produced by this driver\r
+//\r
+EFI_SECURITY_ARCH_PROTOCOL  mSecurityStub = { \r
+  SecurityStubAuthenticateState \r
+};\r
 \r
 /**\r
-  The user Entry Point installs SAP. The user code starts with this function\r
-  as the real entry point for the image goes into a library that calls this \r
-  function.\r
+  Installs Security Architectural Protocol.\r
 \r
-  @param ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param SystemTable    A pointer to the EFI System Table.\r
+  @param  ImageHandle  The image handle of this driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
   \r
   @retval EFI_SUCCESS   Install the sample Security Architectural Protocol successfully.\r
 \r
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.h b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.h
deleted file mode 100644 (file)
index ff4f9bc..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file\r
-  Inlcude the required definitions for Security Architectural Protocol stub driver\r
-\r
-  Copyright (c) 2006 - 2008, 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
-**/\r
-\r
-#ifndef __SECURITY_STUB_ARCH_PROTOCOL_H__\r
-#define __SECURITY_STUB_ARCH_PROTOCOL_H__\r
-\r
-\r
-//\r
-// Common header files for this module.\r
-//\r
-#include <Uefi.h>\r
-#include <Protocol/Security.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-\r
-//\r
-// Function prototypes\r
-//\r
-/**\r
-  The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific \r
-  policy from the DXE core response to an attempt to use a file that returns a \r
-  given status for the authentication check from the section extraction protocol.  \r
-\r
-  The possible responses in a given SAP implementation may include locking \r
-  flash upon failure to authenticate, attestation logging for all signed drivers, \r
-  and other exception operations.  The File parameter allows for possible logging \r
-  within the SAP of the driver.\r
-\r
-  If File is NULL, then EFI_INVALID_PARAMETER is returned.\r
-\r
-  If the file specified by File with an authentication status specified by \r
-  AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.\r
-\r
-  If the file specified by File with an authentication status specified by \r
-  AuthenticationStatus is not safe for the DXE Core to use under any circumstances, \r
-  then EFI_ACCESS_DENIED is returned.\r
-\r
-  If the file specified by File with an authentication status specified by \r
-  AuthenticationStatus is not safe for the DXE Core to use right now, but it \r
-  might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is \r
-  returned.\r
-\r
-  @param  This             The EFI_SECURITY_ARCH_PROTOCOL instance.\r
-  @param  AuthenticationStatus \r
-                           This is the authentication type returned from the Section\r
-                           Extraction protocol. See the Section Extraction Protocol\r
-                           Specification for details on this type.\r
-  @param  File             This is a pointer to the device path of the file that is\r
-                           being dispatched. This will optionally be used for logging.\r
-\r
-  @retval EFI_SUCCESS            Do nothing and return.\r
-  @retval EFI_INVALID_PARAMETER  File is NULL.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecurityStubAuthenticateState (\r
-  IN CONST EFI_SECURITY_ARCH_PROTOCOL    *This,\r
-  IN UINT32                              AuthenticationStatus,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL      *File\r
-  );\r
-\r
-/**\r
-  The user Entry Point for DXE driver. The user code starts with this function\r
-  as the real entry point for the image goes into a library that calls this \r
-  function.\r
-\r
-  @param ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS   Install the sample Security Architectural Protocol successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecurityStubInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  );\r
-\r
-#endif\r
index 8d70dbe38c3db6938fbc18e5f69200043297b090..71c5a8ef388d3014d8e2d99842bac638203a0184 100644 (file)
@@ -1,5 +1,6 @@
 #/** @file\r
-#  Sample SecurityStub module implements the dummy platform security service.\r
+#  Sample SecurityStub driver implements the dummy platform security service.\r
+#  It always return success without any authentication check.\r
 #\r
 #  Copyright (c) 2006 - 2008, Intel Corporation\r
 #  All rights reserved. This program and the accompanying materials\r
@@ -28,7 +29,6 @@
 \r
 [Sources.common]\r
   SecurityStub.c\r
-  SecurityStub.h\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
@@ -42,4 +42,4 @@
   gEfiSecurityArchProtocolGuid                  # PROTOCOL ALWAYS_PRODUCED\r
 \r
 [Depex]\r
-  TRUE
\ No newline at end of file
+  TRUE\r