]> git.proxmox.com Git - mirror_edk2.git/commitdiff
According to PI errata 0000654 and 000811, we need use 0xFFFE to instead of 0 for...
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Nov 2011 08:50:41 +0000 (08:50 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Nov 2011 08:50:41 +0000 (08:50 +0000)
Signed-off-by: lzeng14
Reviewed-by: li-elvin
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12746 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c

index b39ea23a8f0af8932b21094134aee45f249ce9dd..053e7a4984ed0f7be644413c6b074c6e58f8d441 100644 (file)
@@ -264,7 +264,7 @@ GetAvailableSmbiosHandle (
 \r
   Private = SMBIOS_INSTANCE_FROM_THIS (This);\r
   Head = &Private->AllocatedHandleListHead;\r
-  for (AvailableHandle = 1; AvailableHandle < MaxSmbiosHandle; AvailableHandle++) {\r
+  for (AvailableHandle = 0; AvailableHandle < MaxSmbiosHandle; AvailableHandle++) {\r
     if (!CheckSmbiosHandleExistance(Head, AvailableHandle)) {\r
       *Handle = AvailableHandle;\r
       return EFI_SUCCESS;\r
@@ -281,8 +281,8 @@ GetAvailableSmbiosHandle (
   @param  This                  The EFI_SMBIOS_PROTOCOL instance.\r
   @param  ProducerHandle        The handle of the controller or driver associated with the SMBIOS information. NULL\r
                                 means no handle.\r
-  @param  SmbiosHandle          On entry, if non-zero, the handle of the SMBIOS record. If zero, then a unique handle\r
-                                will be assigned to the SMBIOS record. If the SMBIOS handle is already in use\r
+  @param  SmbiosHandle          On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle\r
+                                will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,\r
                                 EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.\r
   @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
                                 determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
@@ -325,14 +325,14 @@ SmbiosAdd (
   // Check whether SmbiosHandle is already in use\r
   //\r
   Head = &Private->AllocatedHandleListHead;\r
-  if (*SmbiosHandle != 0 && CheckSmbiosHandleExistance(Head, *SmbiosHandle)) {\r
+  if (*SmbiosHandle != SMBIOS_HANDLE_PI_RESERVED && CheckSmbiosHandleExistance(Head, *SmbiosHandle)) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
   //\r
-  // when SmbiosHandle is zero, an available handle will be assigned\r
+  // when SmbiosHandle is 0xFFFE, an available handle will be assigned\r
   //\r
-  if (*SmbiosHandle == 0) {\r
+  if (*SmbiosHandle == SMBIOS_HANDLE_PI_RESERVED) {\r
     Status = GetAvailableSmbiosHandle(This, SmbiosHandle);\r
     if (EFI_ERROR(Status)) {\r
       return Status;\r
@@ -434,7 +434,7 @@ SmbiosAdd (
 \r
   @retval EFI_SUCCESS           SmbiosHandle had its StringNumber String updated.\r
   @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist.\r
-  @retval EFI_UNSUPPORTED       String was not added since it's longer than 64 significant characters.\r
+  @retval EFI_UNSUPPORTED       String was not added because it is longer than the SMBIOS Table supports.\r
   @retval EFI_NOT_FOUND         The StringNumber.is not valid for this SMBIOS record.\r
 \r
 **/\r
@@ -711,8 +711,8 @@ SmbiosRemove (
 \r
   @param  This                  The EFI_SMBIOS_PROTOCOL instance.\r
   @param  SmbiosHandle          On entry, points to the previous handle of the SMBIOS record. On exit, points to the\r
-                                next SMBIOS record handle. If it is zero on entry, then the first SMBIOS record\r
-                                handle will be returned. If it returns zero on exit, then there are no more SMBIOS records.\r
+                                next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record\r
+                                handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.\r
   @param  Type                  On entry it means return the next SMBIOS record of type Type. If a NULL is passed in \r
                                 this functionally it ignored. Type is not modified by the GetNext() function.\r
   @param  Record                On exit, points to the SMBIOS Record consisting of the formatted area followed by\r
@@ -753,9 +753,9 @@ SmbiosGetNext (
     SmbiosTableHeader = (EFI_SMBIOS_TABLE_HEADER*)(SmbiosEntry->RecordHeader + 1); \r
 \r
     //\r
-    // If SmbiosHandle is zero, the first matched SMBIOS record handle will be returned\r
+    // If SmbiosHandle is 0xFFFE, the first matched SMBIOS record handle will be returned\r
     //\r
-    if (*SmbiosHandle == 0) {\r
+    if (*SmbiosHandle == SMBIOS_HANDLE_PI_RESERVED) {\r
       if ((Type != NULL) && (*Type != SmbiosTableHeader->Type)) {\r
         continue;  \r
       }\r
@@ -791,7 +791,7 @@ SmbiosGetNext (
     }\r
   }\r
 \r
-  *SmbiosHandle = 0;\r
+  *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
   return EFI_NOT_FOUND;\r
   \r
 }\r