Intel ARCHITECTURE IA-32 User Manual Page 309

  • Download
  • Add to my manuals
  • Print
  • Page
    / 636
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 308
Vol. 3A 7-41
MULTIPLE-PROCESSOR MANAGEMENT
6. Extract a sub ID given a full ID, maximum sub ID value and shift count.
// Returns the value of the sub ID, this is not a zero-based value
Unsigned char GetSubID(unsigned char Full_ID, unsigned char MaxSubIDvalue, unsigned
char Shift_Count)
{
MaskWidth = FindMaskWidth(MaxSubIDValue);
MaskBits = ((uchar) (0xff << Shift_Count)) ^ ((uchar) (0xff << Shift_Count + MaskWidth)) ;
SubID = Full_ID & MaskBits;
Return SubID;
}
Software must not assume local APIC_ID values in an MP system are consecutive. Non-consec-
utive local APIC_IDs may be the result of hardware configurations or debug features imple-
mented in the BIOS or OS.
An identifier for each hierarchical level can be extracted from an 8-bit APIC_ID using the
support routines illustrated in Example 7-1. The appropriate bit mask and shift value to construct
the appropriate bit mask for each level must be determined dynamically at runtime.
7.10.4 Identifying Topological Relationships in a MP System
To detect the number of physical packages, processor cores, or other topological relationships
in a MP system, the following procedures are recommended:
Extract the three-level identifiers from the APIC ID of each logical processor enabled by
system software. The sequence is as follows (See the pseudo code shown in Example 7-2
and support routines shown in Example 7-1):
The extraction start from the right-most bit field, corresponding to SMT_ID, the
innermost hierarchy in a three-level topology (See Figure 7-6). For the right-most
bit field, the shift value of the working mask is zero. The width of the bit field is
determined dynamically using the maximum number of logical processor per core,
which can be derived from information provided from CPUID.
To extract the next bit-field, the shift value of the working mask is determined
from the width of the bit mask of the previous step. The width of the bit field is
determined dynamically using the maximum number of cores per package.
To extract the remaining bit-field, the shift value of the working mask is
determined from the maximum number of logical processor per package. So the
remaining bits in the APIC ID (excluding those bits already extracted in the two
previous steps) are extracted as the third identifier. This applies to a non-clustered
MP system, or if there is no need to distinguish between PACKAGE_ID and
CLUSTER_ID.
If there is need to distinguish between PACKAGE_ID and CLUSTER_ID,
PACKAGE_ID can be extracted using an algorithm similar to the extraction of
Page view 308
1 2 ... 304 305 306 307 308 309 310 311 312 313 314 ... 635 636

Comments to this Manuals

No comments