> + /// Check if extended toplogy supported > + AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedCpuIdIndex, NULL, NULL, > NULL); > + if (MaxExtendedCpuIdIndex >= AMD_CPUID_EXTENDED_TOPOLOGY) { > + do { > + AsmCpuidEx ( > + AMD_CPUID_EXTENDED_TOPOLOGY, > + TopologyLevel, > + &ExtendedTopologyEax.Uint32, > + &ExtendedTopologyEbx.Uint32, > + &ExtendedTopologyEcx.Uint32, > + NULL > + ); > + > + if (ExtendedTopologyEbx.Bits.LogicalProcessors == > CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_INVALID) {
Comparing LogicalProcessors with CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_* looks wrong, even though it probably works due to CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_INVALID being zero ... > + /// if this fails at first level > + /// then will fall back to non-extended topology > + break; > + } > + } while (ExtendedTopologyEbx.Bits.LogicalProcessors != > CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_INVALID); Same here. Also this will never be false because the check above already quits the loop in that case, so you can simplify this to "while (true)". take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113954): https://edk2.groups.io/g/devel/message/113954 Mute This Topic: https://groups.io/mt/103782768/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-