]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c
1) Initialize gBS, gST, gImageHandle in UefiBootServicesTableLib.c to NULL
[mirror_edk2.git] / EdkModulePkg / Core / Dxe / Misc / InstallConfigurationTable.c
index e81fcad35ae275ca54c5fee23425ea7557ba9bc1..ee42f224e85dd15842fdbb1309bb9b99a3888b0f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, 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
@@ -54,9 +54,9 @@ Returns:
 {\r
   UINTN Index;\r
 \r
-  for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {\r
-    if (CompareGuid (Guid, &(gST->ConfigurationTable[Index].VendorGuid))) {\r
-      *Table = gST->ConfigurationTable[Index].VendorTable;\r
+  for (Index = 0; Index < gDxeCoreST->NumberOfTableEntries; Index++) {\r
+    if (CompareGuid (Guid, &(gDxeCoreST->ConfigurationTable[Index].VendorGuid))) {\r
+      *Table = gDxeCoreST->ConfigurationTable[Index].VendorTable;\r
       return EFI_SUCCESS;\r
     }\r
   }\r
@@ -104,18 +104,18 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  EfiConfigurationTable = gST->ConfigurationTable;\r
+  EfiConfigurationTable = gDxeCoreST->ConfigurationTable;\r
 \r
   //\r
   // Search all the table for an entry that matches Guid\r
   //\r
-  for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {\r
-    if (CompareGuid (Guid, &(gST->ConfigurationTable[Index].VendorGuid))) {\r
+  for (Index = 0; Index < gDxeCoreST->NumberOfTableEntries; Index++) {\r
+    if (CompareGuid (Guid, &(gDxeCoreST->ConfigurationTable[Index].VendorGuid))) {\r
       break;\r
     }\r
   }\r
 \r
-  if (Index < gST->NumberOfTableEntries) {\r
+  if (Index < gDxeCoreST->NumberOfTableEntries) {\r
     //\r
     // A match was found, so this is either a modify or a delete operation\r
     //\r
@@ -124,22 +124,22 @@ Returns:
       // If Table is not NULL, then this is a modify operation.\r
       // Modify the table enty and return.\r
       //\r
-      gST->ConfigurationTable[Index].VendorTable = Table;\r
+      gDxeCoreST->ConfigurationTable[Index].VendorTable = Table;\r
       return EFI_SUCCESS;\r
     }\r
 \r
     //\r
     // A match was found and Table is NULL, so this is a delete operation.\r
     //\r
-    gST->NumberOfTableEntries--;\r
+    gDxeCoreST->NumberOfTableEntries--;\r
 \r
     //\r
     // Copy over deleted entry\r
     //\r
     CopyMem (\r
       &(EfiConfigurationTable[Index]),\r
-      &(gST->ConfigurationTable[Index + 1]),\r
-      (gST->NumberOfTableEntries - Index) * sizeof (EFI_CONFIGURATION_TABLE)\r
+      &(gDxeCoreST->ConfigurationTable[Index + 1]),\r
+      (gDxeCoreST->NumberOfTableEntries - Index) * sizeof (EFI_CONFIGURATION_TABLE)\r
       );\r
 \r
   } else {\r
@@ -156,7 +156,7 @@ Returns:
     }\r
 \r
     //\r
-    // Assume that Index == gST->NumberOfTableEntries\r
+    // Assume that Index == gDxeCoreST->NumberOfTableEntries\r
     //\r
     if ((Index * sizeof (EFI_CONFIGURATION_TABLE)) >= mSystemTableAllocateSize) {\r
       //\r
@@ -171,26 +171,26 @@ Returns:
         return EFI_OUT_OF_RESOURCES;\r
       }\r
 \r
-      if (gST->ConfigurationTable != NULL) {\r
+      if (gDxeCoreST->ConfigurationTable != NULL) {\r
         //\r
         // Copy the old table to the new table.\r
         //\r
         CopyMem (\r
           EfiConfigurationTable,\r
-          gST->ConfigurationTable,\r
+          gDxeCoreST->ConfigurationTable,\r
           Index * sizeof (EFI_CONFIGURATION_TABLE)\r
           );\r
 \r
         //\r
         // Free Old Table\r
         //\r
-        CoreFreePool (gST->ConfigurationTable);\r
+        CoreFreePool (gDxeCoreST->ConfigurationTable);\r
       }\r
 \r
       //\r
       // Update System Table\r
       //\r
-      gST->ConfigurationTable = EfiConfigurationTable;\r
+      gDxeCoreST->ConfigurationTable = EfiConfigurationTable;\r
     }\r
 \r
     //\r
@@ -202,13 +202,13 @@ Returns:
     //\r
     // This is an add operation, so increment the number of table entries\r
     //\r
-    gST->NumberOfTableEntries++;\r
+    gDxeCoreST->NumberOfTableEntries++;\r
   }\r
 \r
   //\r
   // Fix up the CRC-32 in the EFI System Table\r
   //\r
-  CalculateEfiHdrCrc (&gST->Hdr);\r
+  CalculateEfiHdrCrc (&gDxeCoreST->Hdr);\r
 \r
   return EFI_SUCCESS;\r
 }\r