]> git.proxmox.com Git - mirror_edk2.git/blobdiff - QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c
QuarkSocPkg/QncSmmDispatcher: Fix context passed to SMI handlers
[mirror_edk2.git] / QuarkSocPkg / QuarkNorthCluster / Smm / DxeSmm / QncSmmDispatcher / QNCSmmCore.c
index ba8c72177361af77cc9c08ac11c503109ef853c6..47834064ffc121f9e86499792981fbd47904db9a 100644 (file)
@@ -2,7 +2,7 @@
 This driver is responsible for the registration of child drivers\r
 and the abstraction of the QNC SMI sources.\r
 \r
 This driver is responsible for the registration of child drivers\r
 and the abstraction of the QNC SMI sources.\r
 \r
-Copyright (c) 2013-2015 Intel Corporation.\r
+Copyright (c) 2013-2016 Intel Corporation.\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -351,7 +351,8 @@ Returns:
   // Gather information about the registration request\r
   //\r
   Record->Callback          = DispatchFunction;\r
   // Gather information about the registration request\r
   //\r
   Record->Callback          = DispatchFunction;\r
-  Record->ChildContext      = *RegisterContext;\r
+  Record->CallbackContext   = RegisterContext;\r
+  CopyMem (&Record->ChildContext, RegisterContext, sizeof (QNC_SMM_CONTEXT));\r
 \r
   Qualified                 = QUALIFIED_PROTOCOL_FROM_GENERIC (This);\r
 \r
 \r
   Qualified                 = QUALIFIED_PROTOCOL_FROM_GENERIC (This);\r
 \r
@@ -407,7 +408,7 @@ Returns:
       //\r
       // Update ChildContext again as SwSmiInputValue has been changed\r
       //\r
       //\r
       // Update ChildContext again as SwSmiInputValue has been changed\r
       //\r
-      Record->ChildContext = *RegisterContext;\r
+      CopyMem (&Record->ChildContext, RegisterContext, sizeof (QNC_SMM_CONTEXT));\r
     }\r
 \r
     //\r
     }\r
 \r
     //\r
@@ -688,7 +689,6 @@ QNCSmmCoreDispatcher (
                 // it supplied in registration.  Simply pass back what it gave us.\r
                 //\r
                 ASSERT (RecordToExhaust->Callback != NULL);\r
                 // it supplied in registration.  Simply pass back what it gave us.\r
                 //\r
                 ASSERT (RecordToExhaust->Callback != NULL);\r
-                Context       = RecordToExhaust->ChildContext;\r
                 ContextsMatch = TRUE;\r
               }\r
 \r
                 ContextsMatch = TRUE;\r
               }\r
 \r
@@ -710,7 +710,7 @@ QNCSmmCoreDispatcher (
 \r
                 RecordToExhaust->Callback (\r
                                    (EFI_HANDLE) & RecordToExhaust->Link,\r
 \r
                 RecordToExhaust->Callback (\r
                                    (EFI_HANDLE) & RecordToExhaust->Link,\r
-                                   &Context,\r
+                                   RecordToExhaust->CallbackContext,\r
                                    CommunicationBuffer,\r
                                    &BufferSize\r
                                    );\r
                                    CommunicationBuffer,\r
                                    &BufferSize\r
                                    );\r