From 2d7b3c0316e20bf6b558bdb524d32204b48159ed Mon Sep 17 00:00:00 2001 From: xli24 Date: Thu, 25 Feb 2010 10:37:09 +0000 Subject: Add parameter checking for MP Services Protocol Thunk driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10070 6f19259b-4bc3-4df7-8a09-765794883524 --- .../MpServicesOnFrameworkMpServicesThunk.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'EdkCompatibilityPkg') diff --git a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.c b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.c index fcb3373..b31d17c 100644 --- a/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.c +++ b/EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.c @@ -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. This module produces PI MP Services Protocol on top of Framework MP Services Protocol. -Copyright (c) 2009 Intel Corporation.
+Copyright (c) 2009 - 2010 Intel Corporation.
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -898,6 +898,8 @@ CheckThisAP ( CPU_DATA_BLOCK *CpuData; CPU_STATE CpuState; + ASSERT (ProcessorNumber < mNumberOfProcessors); + CpuData = &mMPSystemData.CpuData[ProcessorNumber]; // @@ -1217,6 +1219,8 @@ WakeUpAp ( CPU_DATA_BLOCK *CpuData; EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer; + ASSERT (ProcessorNumber < mNumberOfProcessors); + CpuData = &mMPSystemData.CpuData[ProcessorNumber]; AcquireSpinLock (&CpuData->CpuDataLock); @@ -1295,6 +1299,8 @@ ChangeCpuState ( { CPU_DATA_BLOCK *CpuData; + ASSERT (ProcessorNumber < mNumberOfProcessors); + CpuData = &mMPSystemData.CpuData[ProcessorNumber]; if (!NewState) { @@ -1578,6 +1584,7 @@ InitializeMpServicesProtocol ( NULL ); ASSERT_EFI_ERROR (Status); + ASSERT (mNumberOfProcessors < MAX_CPU_NUMBER); // // Create timer event to check AP state for non-blocking execution. -- cgit v1.1