> + ZeroMem (mSmmInitialized, sizeof (BOOLEAN) * mMaxNumberOfCpus); > ... > + for (Index = 0; Index < mNumberOfCpus; Index++) { > + while (mSmmInitialized[Index] == FALSE) { > + }
Above code sets the BOOLEAN array to all FALSE. Then polling on the array to be all TRUE. We need to add "volatile" to the mSmmInitialized to tell the compiler not to optimize the code but always check the memory content. A better way is to use compiler barrier but there is no edk2 lib API to wrap it for different compilers Let's just use "volatile" for now. Thanks, Ray -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100004): https://edk2.groups.io/g/devel/message/100004 Mute This Topic: https://groups.io/mt/96871374/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-