dmi_memory_device_addr
Synopsis
#include <opendmi/entity/memory-device-addr.h>
typedef struct dmi_memory_device_addr {
uint64_t start_address;
uint64_t end_address;
uint64_t range_size;
dmi_handle_t device_handle;
dmi_entity_t *device;
dmi_handle_t array_address_handle;
dmi_entity_t *array_addr;
unsigned short partition_pos;
unsigned short interleave_pos;
unsigned short interleave_depth;
} dmi_memory_device_addr_t;
Description
The dmi_memory_device_addr_t structure holds the decoded memory device mapped
address structure (type 20) of SMBIOS: a contiguous range of physical
addresses mapped to a memory device, the memory array mapped address
structure (type 19) whose range it is a part of, and the position of the
device in the partition and in the interleave. A table holds one structure
for each such range; devices without a mapped address have none, since the
structure cannot describe an empty range.
The structure is returned by dmi_entity_info for the structures of type
DMI_TYPE(memory_device_addr), and lives as long as the context it has been
decoded in.
Fields
start_address-
Physical address of the start of the range, in bytes. The SMBIOS 2.1 field counts in kibibytes; ranges it cannot express are carried by an extended field in bytes, present since SMBIOS 2.7.
end_address-
Physical address of the last byte of the range. Taken from the SMBIOS 2.1 field, which counts in kibibytes, it is the last byte of the last kibibyte of the range; the extended field (SMBIOS 2.7), which is used when the 2.1 fields hold FFFFFFFFh, gives the last byte itself.
range_size-
Size of the range, in bytes, computed from
start_addressandend_address, both of which belong to the range. device_handle-
Handle of the memory device structure (type 17) the range is mapped to. Several ranges can be mapped to the same device.
device-
The memory device structure
device_handlerefers to, resolved while linking.nullptrif the handle is not set or does not refer to a memory device, or before the structures are linked. array_address_handle-
Handle of the memory array mapped address structure (type 19) the range is a part of. Several device ranges can belong to the same array range.
array_address-
The memory array mapped address structure
array_address_handlerefers to, resolved while linking.nullptrif the handle is not set or does not refer to such a structure, or before the structures are linked. partition_pos-
Position of the device within a row of the address partition, starting at 1: with two 8-bit devices forming a 16-bit row, 1 or 2. Zero is reserved,
USHRT_MAXmeans unknown. interleave_pos-
Position of the device in the interleave: 0 if the range is not interleaved, 1 for the first position, 2 for the second, and so on. With a 2:1 interleave, 1 is the "even" position; with a 4:1 interleave, 1 is the first of four.
USHRT_MAXif unknown. interleave_depth-
Largest number of consecutive rows of the device read in a single interleaved transfer. Zero if the device is not interleaved,
USHRT_MAXif the interleave configuration is unknown.
Examples
dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t *entity = dmi_registry_lookup_first(registry,
DMI_TYPE(memory_device_addr), false);
dmi_memory_device_addr_t *range = dmi_entity_info(entity,
DMI_TYPE(memory_device_addr));
if (range != nullptr)
printf("0x%llX-0x%llX: memory device 0x%04X\n",
(unsigned long long)range->start_address,
(unsigned long long)range->end_address,
(unsigned)range->device_handle);