]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/FSVariable/FSVariable.c
Fix some bugs in FSVariable and BdsPlatform for duet platform.
[mirror_edk2.git] / DuetPkg / FSVariable / FSVariable.c
index cfe76ccc9500d9a8298fb293733bac125d290227..0977887818e51756459a5f9071729db48dd509e4 100644 (file)
@@ -743,7 +743,6 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
   //\r
   //  The size of the VariableName, including the Unicode Null in bytes plus\r
   //  the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)\r
@@ -760,16 +759,7 @@ Returns:
       return EFI_INVALID_PARAMETER;\r
     }  \r
   }  \r
-#else  \r
-  //\r
-  //  The size of the VariableName, including the Unicode Null in bytes plus\r
-  //  the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.\r
-  //\r
-  if ((DataSize > MAX_VARIABLE_SIZE) ||\r
-      (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }  \r
-#endif\r
+\r
   //\r
   // Check whether the input variable is already existed\r
   //\r
@@ -984,7 +974,6 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
 EFI_STATUS\r
 EFIAPI\r
 QueryVariableInfo (\r
@@ -1028,21 +1017,12 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)  \r
   if((Attributes & (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) == 0) {\r
     //\r
     // Make sure the Attributes combination is supported by the platform.\r
     //\r
     return EFI_UNSUPPORTED;  \r
   }  \r
-#else\r
-  if((Attributes & (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)) == 0) {\r
-    //\r
-    // Make sure the Attributes combination is supported by the platform.\r
-    //\r
-    return EFI_UNSUPPORTED;  \r
-  } \r
-#endif  \r
   else if ((Attributes & (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS)) == EFI_VARIABLE_RUNTIME_ACCESS) {\r
     //\r
     // Make sure if runtime bit is set, boot service bit is set also.\r
@@ -1070,14 +1050,12 @@ Returns:
   //\r
   *MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
   //\r
   // Harware error record variable needs larger size.\r
   //\r
   if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {\r
     *MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);\r
   }\r
-#endif\r
   \r
   //\r
   // Point to the starting address of the variables.\r
@@ -1124,7 +1102,6 @@ Returns:
 \r
   return EFI_SUCCESS;\r
 }\r
-#endif\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -1299,9 +1276,7 @@ Returns:
   SystemTable->RuntimeServices->GetNextVariableName = GetNextVariableName;\r
   SystemTable->RuntimeServices->SetVariable         = SetVariable;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   SystemTable->RuntimeServices->QueryVariableInfo   = QueryVariableInfo;\r
-#endif\r
 \r
   //\r
   // Now install the Variable Runtime Architectural Protocol on a new handle\r