Intel Extensible Firmware Interface Network Router User Manual


  Open as PDF
of 1084
 
Extensible Firmware Interface Specification
19-6 12/01/02 Version 1.10
19.4.2 Bits Assigned to Natural Units
This 3-bit field that is used to determine the width of the natural units field. The units vary based
on the size of the index according to Table 19-5. For example, for a 16-bit index, the value
contained in this field would be multiplied by 2 to get the actual width of the natural-units field.
Table 19-5. Index Size in Index Encoding
Index Size Units
16 bits 2 bits
32 bits 4 bits
64 bits 8 bits
19.4.3 Constant
The constant is the number of bytes in the index that do not scale with processor size. When the
index is a 16-bit value, the maximum constant is 4095. This index is achieved when the bits
assigned to natural units is 0.
19.4.4 Natural Units
Natural units are used when a structure has fields that can vary with the architecture of the
processor. Fields that precipitate the use of natural units include pointers and EFI INTN and
UINTN data types. The size of one pointer or INTN/UINTN equals one natural unit. The natural
units field in an index encoding is a count of the number of natural fields whose sizes (in bytes)
must be added to determine a field offset.
As an example, assume that a given EBC instruction specifies a 16-bit index of 0xA048. This
breaks down into:
Sign bit (bit 15) = 1 (negative offset)
Bits assigned to natural units (w, bits 14-12) = 2. Multiply by index size in bytes = 2 x 2 = 4 (A)
c = bits 11-4 = 4
n = bits 3-0 = 8
On a 32-bit machine, the offset is then calculated to be:
Offset = (4 + 8 * 4) * -1 = -36
On a 64-bit machine, the offset is calculated to be:
Offset = (4 + 8 * 8) * -1 = -68