Fix a critical bug that the Migration Tool mistakenly creates exit-boot-services...
authorqhuang8 <qhuang8@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 29 Aug 2007 02:20:58 +0000 (02:20 +0000)
committerqhuang8 <qhuang8@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 29 Aug 2007 02:20:58 +0000 (02:20 +0000)
This only happens when the extra option "-e" is on (by default it is off).

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@633 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/MigrationMsa2Inf/AutoGenExterns.py
Source/Python/MigrationMsa2Inf/MigrationMsa2Inf.py

index 2d2f487..16f7a6b 100644 (file)
@@ -241,7 +241,7 @@ def AddBootServiceEventStatement(EventList):
     \r
     CreateStatement  = "\n"\r
     CreateStatement += "  Status = gBS->CreateEvent (\n"\r
-    CreateStatement += "                  EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\n"\r
+    CreateStatement += "                  EVT_SIGNAL_EXIT_BOOT_SERVICES,\n"\r
     CreateStatement += "                  EFI_TPL_NOTIFY,\n"\r
     CreateStatement += "                  " + FinalEvent + ",\n"\r
     CreateStatement += "                  NULL,\n"\r
@@ -260,18 +260,19 @@ def AddBootServiceEventStatement(EventList):
     return (CreateStatement, "", GlobalDefinition, GlobalDeclaration)\r
 \r
 def AddVirtualAddressEventStatement(EventList):\r
+    FinalEvent = ""\r
     if len(EventList) > 1:\r
         print "Current prototype does not support multi virtual address change event"\r
-\r
-    FinalEvent       = EventList[0]\r
+    else:\r
+        FinalEvent       = EventList[0]\r
+    \r
     CreateStatement  = "\n"\r
-    Indention        = "                  "\r
 \r
     CreateStatement += "  Status = gBS->CreateEvent (\n"\r
-    CreateStatement += "                  EVT_SIGNAL_EXIT_BOOT_SERVICES,\n"\r
+    CreateStatement += "                  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\n"\r
     CreateStatement += "                  TPL_NOTIFY,\n"\r
     CreateStatement += "                  " + FinalEvent + ",\n"\r
-    CreateStatement += "                  NULL,\n",\r
+    CreateStatement += "                  NULL,\n"\r
     CreateStatement += "                  &mVirtualAddressChangedEvent\n"\r
     CreateStatement += "                  );\n"\r
     CreateStatement += "  ASSERT_EFI_ERROR (Status);\n"\r
@@ -282,7 +283,7 @@ def AddVirtualAddressEventStatement(EventList):
     GlobalDeclaration = EventDeclarationTemplate % FinalEvent\r
 \r
     DestroyStatement  = "\n"\r
-    DestroyStatement += "  Status = gBS->CloseEvent (mExitBootServicesEvent);\n"\r
+    DestroyStatement += "  Status = gBS->CloseEvent (mVirtualAddressChangedEvent);\n"\r
     DestroyStatement += "  ASSERT_EFI_ERROR (Status);\n"\r
     \r
     return (CreateStatement, "", GlobalDefinition, GlobalDeclaration)\r
index 4555ba8..73719d6 100644 (file)
@@ -1684,7 +1684,7 @@ def main():
         if (len(AutoGenVirtualAddressChanged) > 0):
             print "[Warning] Please manually add Create Event statement for Virtual Address Change Event!"
             if options.event:
-                AutoGenCode = AddBootServiceEventStatement(AutoGenVirtualAddressChanged)
+                AutoGenCode = AddVirtualAddressEventStatement(AutoGenVirtualAddressChanged)
                 AutoGenEntryPointSource += AutoGenCode[0]
                 AutoGenUnloadSource += AutoGenCode[1]
                 AutoGenDefinitionSource += AutoGenCode[2]