+ CoreAcquireGcdMemoryLock ();\r
+ while (TRUE) {\r
+ //\r
+ // Count descriptors. It might be done more than once because the\r
+ // AllocatePool() called below has to be running outside the GCD lock.\r
+ //\r
+ DescriptorCount = CoreCountGcdMapEntry (&mGcdMemorySpaceMap);\r
+ if (DescriptorCount == *NumberOfDescriptors) {\r
+ //\r
+ // Fill in the MemorySpaceMap if no memory space map change.\r
+ //\r
+ Descriptor = *MemorySpaceMap;\r
+ Link = mGcdMemorySpaceMap.ForwardLink;\r
+ while (Link != &mGcdMemorySpaceMap) {\r
+ Entry = CR (Link, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE);\r
+ BuildMemoryDescriptor (Descriptor, Entry);\r
+ Descriptor++;\r
+ Link = Link->ForwardLink;\r
+ }\r
+ //\r
+ // We're done; exit the loop with the lock held.\r
+ //\r
+ break;\r
+ }\r