};\r
GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mMemoryProfileContextPtr = NULL;\r
\r
+EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);\r
BOOLEAN mMemoryProfileGettingStatus = FALSE;\r
BOOLEAN mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;\r
EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;\r
ProfileProtocolRecord,\r
};\r
\r
+/**\r
+ Acquire lock on mMemoryProfileLock.\r
+**/\r
+VOID\r
+CoreAcquireMemoryProfileLock (\r
+ VOID\r
+ )\r
+{\r
+ CoreAcquireLock (&mMemoryProfileLock);\r
+}\r
+\r
+/**\r
+ Release lock on mMemoryProfileLock.\r
+**/\r
+VOID\r
+CoreReleaseMemoryProfileLock (\r
+ VOID\r
+ )\r
+{\r
+ CoreReleaseLock (&mMemoryProfileLock);\r
+}\r
+\r
/**\r
Return memory profile context.\r
\r
return EFI_UNSUPPORTED;\r
}\r
\r
+ CoreAcquireMemoryProfileLock ();\r
switch (BasicAction) {\r
case MemoryProfileActionAllocatePages:\r
Status = CoreUpdateProfileAllocate (CallerAddress, Action, MemoryType, Size, Buffer, ActionString);\r
Status = EFI_UNSUPPORTED;\r
break;\r
}\r
+ CoreReleaseMemoryProfileLock ();\r
+\r
return Status;\r
}\r
\r