]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add parameter checking for MP Services Protocol Thunk driver.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Feb 2010 10:37:09 +0000 (10:37 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Feb 2010 10:37:09 +0000 (10:37 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10070 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.c

index fcb3373adda8933d9001fc957d9e1fd5dd4c4f68..b31d17c47f420b1f894298e5d68646799d36dd46 100644 (file)
@@ -4,7 +4,7 @@ Produces PI MP Services Protocol on top of Framework MP Services Protocol.
 Intel's Framework MP Services Protocol is replaced by EFI_MP_SERVICES_PROTOCOL in PI 1.1.\r
 This module produces PI MP Services Protocol on top of Framework MP Services Protocol.\r
 \r
-Copyright (c) 2009 Intel Corporation. <BR>\r
+Copyright (c) 2009 - 2010 Intel Corporation. <BR>\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
@@ -898,6 +898,8 @@ CheckThisAP (
   CPU_DATA_BLOCK  *CpuData;\r
   CPU_STATE       CpuState;\r
 \r
+  ASSERT (ProcessorNumber < mNumberOfProcessors);\r
+\r
   CpuData = &mMPSystemData.CpuData[ProcessorNumber];\r
 \r
   //\r
@@ -1217,6 +1219,8 @@ WakeUpAp (
   CPU_DATA_BLOCK               *CpuData;\r
   EFI_PROCESSOR_INFORMATION    ProcessorInfoBuffer;\r
 \r
+  ASSERT (ProcessorNumber < mNumberOfProcessors);\r
+\r
   CpuData = &mMPSystemData.CpuData[ProcessorNumber];\r
 \r
   AcquireSpinLock (&CpuData->CpuDataLock);\r
@@ -1295,6 +1299,8 @@ ChangeCpuState (
 {\r
   CPU_DATA_BLOCK  *CpuData;\r
 \r
+  ASSERT (ProcessorNumber < mNumberOfProcessors);\r
+\r
   CpuData = &mMPSystemData.CpuData[ProcessorNumber];\r
 \r
   if (!NewState) {\r
@@ -1578,6 +1584,7 @@ InitializeMpServicesProtocol (
                                   NULL\r
                                   );\r
   ASSERT_EFI_ERROR (Status);\r
+  ASSERT (mNumberOfProcessors < MAX_CPU_NUMBER);\r
 \r
   //\r
   // Create timer event to check AP state for non-blocking execution.\r