]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Follow PI1.2c spec, check empty string and return EFI_INVALID_PARAMETER.
authorjyao1 <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Nov 2011 06:28:40 +0000 (06:28 +0000)
committerjyao1 <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Nov 2011 06:28:40 +0000 (06:28 +0000)
Clean up comment according to PI1.2c spec.

signed-off-by: jyao1
reviewed-by: rsun3

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12690 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c
MdePkg/Include/Protocol/S3SaveState.h

index 8769509f76b10b56c0b56248031c2fb7cc1cb894..aa20d6d302f887b5f30d53707ac5ec88b96d1110 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Save the S3 data to S3 boot script. \r
  \r
 /** @file\r
   Save the S3 data to S3 boot script. \r
  \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -1754,9 +1754,15 @@ S3BootScriptLabel (
   EFI_BOOT_SCRIPT_TABLE_HEADER   TableHeader;\r
   UINT32                         LabelLength;\r
   //\r
   EFI_BOOT_SCRIPT_TABLE_HEADER   TableHeader;\r
   UINT32                         LabelLength;\r
   //\r
-  // Assume Label is not NULL\r
+  // Check NULL Label\r
   //\r
   //\r
- if (Label == NULL) {\r
+  if (Label == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  //\r
+  // Check empty Label\r
+  //\r
+  if (Label[0] == '\0') {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
index 15c4b6b90f684ec76716b22a36aab10099ec60a2..249fb8caff85196266859acfdec24996fac1bd9d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation for S3 Boot Script Saver state driver.\r
 \r
 /** @file\r
   Implementation for S3 Boot Script Saver state driver.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -827,7 +827,8 @@ BootScriptInsert (
   @param  Label                 Points to the label which will be inserted in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The label already exists or was inserted.\r
   @param  Label                 Points to the label which will be inserted in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The label already exists or was inserted.\r
-  @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value or the Position is not a valid position in the boot script table..\r
+  @retval EFI_INVALID_PARAMETER The Label is NULL or points to an empty string.\r
+  @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.\r
   \r
 **/\r
 EFI_STATUS\r
   \r
 **/\r
 EFI_STATUS\r
@@ -856,6 +857,7 @@ BootScriptLabel (
 \r
   @retval EFI_SUCCESS           The operation succeeded. \r
   @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The operation succeeded. \r
   @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.\r
+  @retval EFI_INVALID_PARAMETER The RelativePosition is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
index 9879143e4b4df54effe82a61a7d2c75a80b4d46e..d0652d3fd8fc068c27678f9138489e183413d8d6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation for S3 SMM Boot Script Saver state driver.\r
 \r
 /** @file\r
   Implementation for S3 SMM Boot Script Saver state driver.\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -825,7 +825,8 @@ BootScriptInsert (
   @param  Label                 Points to the label which will be inserted in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The label already exists or was inserted.\r
   @param  Label                 Points to the label which will be inserted in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The label already exists or was inserted.\r
-  @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value or the Position is not a valid position in the boot script table..\r
+  @retval EFI_INVALID_PARAMETER The Label is NULL or points to an empty string.\r
+  @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.\r
   \r
 **/\r
 EFI_STATUS\r
   \r
 **/\r
 EFI_STATUS\r
@@ -854,6 +855,7 @@ BootScriptLabel (
 \r
   @retval EFI_SUCCESS           The operation succeeded. \r
   @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.\r
 \r
   @retval EFI_SUCCESS           The operation succeeded. \r
   @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.\r
+  @retval EFI_INVALID_PARAMETER The RelativePosition is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
index 1c8ba72e11e0dd9d61e26130697c2b980cfafa65..5a72dd860d65c48de015a03deaaa939750606c15 100644 (file)
@@ -5,7 +5,7 @@
   to be replayed during an S3 resume.\r
   This protocol is not required for all platforms.\r
   \r
   to be replayed during an S3 resume.\r
   This protocol is not required for all platforms.\r
   \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
   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
   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
@@ -125,7 +125,7 @@ EFI_STATUS
   \r
   @retval    EFI_SUCCESS              The label already exists or was inserted.\r
   @retval    EFI_NOT_FOUND            The label did not already exist and CreateifNotFound was FALSE.\r
   \r
   @retval    EFI_SUCCESS              The label already exists or was inserted.\r
   @retval    EFI_NOT_FOUND            The label did not already exist and CreateifNotFound was FALSE.\r
-  @retval    EFI_INVALID_PARAMETER    The Opcode is an invalid opcode value.\r
+  @retval    EFI_INVALID_PARAMETER    The Label is NULL or points to an empty string.\r
   @retval    EFI_INVALID_PARAMETER    The Position is not a valid position in the boot script table.\r
   @retval    EFI_OUT_OF_RESOURCES     There is insufficient memory to store the boot script.\r
 **/\r
   @retval    EFI_INVALID_PARAMETER    The Position is not a valid position in the boot script table.\r
   @retval    EFI_OUT_OF_RESOURCES     There is insufficient memory to store the boot script.\r
 **/\r
@@ -151,8 +151,9 @@ EFI_STATUS
   @param[in]    Position2           The positions in the boot script table to compare.\r
   @param[out]   RelativePosition    On return, points to the result of the comparison.\r
   \r
   @param[in]    Position2           The positions in the boot script table to compare.\r
   @param[out]   RelativePosition    On return, points to the result of the comparison.\r
   \r
-  @retval   EFI_SUCCESS             The label already exists or was inserted.\r
+  @retval   EFI_SUCCESS             The operation succeeded.\r
   @retval   EFI_INVALID_PARAMETER   The Position1 or Position2 is not a valid position in the boot script table.\r
   @retval   EFI_INVALID_PARAMETER   The Position1 or Position2 is not a valid position in the boot script table.\r
+  @retval   EFI_INVALID_PARAMETER   The RelativePosition is NULL.\r
 **/\r
 typedef\r
 EFI_STATUS\r
 **/\r
 typedef\r
 EFI_STATUS\r