summaryrefslogtreecommitdiff
path: root/target-i386/topology.h
AgeCommit message (Collapse)AuthorFilesLines
2013-02-16target-i386: Inline bitops_flslRichard Henderson1-4/+2
Use clz32 directly. Which makes slightly more sense given that the input is type "int" and not type "long". Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-27target-i386: Topology & APIC ID utility functionsEduardo Habkost1-0/+136
This introduces utility functions for the APIC ID calculation, based on: Intel® 64 Architecture Processor Topology Enumeration http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/ The code should be compatible with AMD's "Extended Method" described at: AMD CPUID Specification (Publication #25481) Section 3: Multiple Core Calcuation as long as: - nr_threads is set to 1; - OFFSET_IDX is assumed to be 0; - CPUID Fn8000_0008_ECX[ApicIdCoreIdSize[3:0]] is set to apicid_core_width(). Unit tests included. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>