Skip to content

Commit 6bd9742

Browse files
author
David Sommerseth
committed
Completed python XML map for TypeMap 0x05
1 parent ebb06f3 commit 6bd9742

2 files changed

Lines changed: 39 additions & 8 deletions

File tree

src/dmidecode.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,10 +1160,11 @@ void dmi_processor_voltage(xmlNode *node, u8 code)
11601160
dmixml_AddAttribute(vltg_n, "unknown_value", "1");
11611161
} else {
11621162
for(i = 0; i <= 2; i++) {
1163-
if( code & (1 << i) ) {
1164-
xmlNode *v_n = dmixml_AddTextChild(vltg_n, "Voltage", "%s", voltage[i]);
1165-
dmixml_AddAttribute(v_n, "unit", "V");
1166-
}
1163+
xmlNode *v_n = dmixml_AddTextChild(vltg_n, "Voltage", "%s", voltage[i]);
1164+
dmixml_AddAttribute(v_n, "key_compound", "%s V", voltage[i]);
1165+
dmixml_AddAttribute(v_n, "available", "%i", (code & (1 << i) ? 1 : 0));
1166+
dmixml_AddAttribute(v_n, "unit", "V");
1167+
v_n = NULL;
11671168
}
11681169
}
11691170
}
@@ -1340,7 +1341,7 @@ void dmi_memory_controller_ec_capabilities(xmlNode *node, const char *tagname, u
13401341
if(code & (1 << i)) {
13411342
xmlNode *c_n = dmixml_AddTextChild(cap_n, "Capability", "%s", capabilities[i]);
13421343
assert( c_n != NULL );
1343-
dmixml_AddAttribute(c_n, "index", "%i", i);
1344+
dmixml_AddAttribute(c_n, "index", "%i", i+1);
13441345
}
13451346
}
13461347
}
@@ -1411,7 +1412,7 @@ void dmi_memory_controller_slots(xmlNode *node, u8 count, const u8 * p)
14111412
assert( mslts_n != NULL );
14121413

14131414
for(i = 0; i < count; i++) {
1414-
xmlNode *sl_n = dmixml_AddTextChild(mslts_n, "Slot", "0x%04x:", WORD(p + sizeof(u16) * i));
1415+
xmlNode *sl_n = dmixml_AddTextChild(mslts_n, "Slot", "0x%x:", WORD(p + sizeof(u16) * i));
14151416
dmixml_AddAttribute(sl_n, "index", "%i", i);
14161417
}
14171418
}
@@ -1448,7 +1449,7 @@ void dmi_memory_module_types(xmlNode *node, const char *tagname, u16 code)
14481449
if(code & (1 << i)) {
14491450
xmlNode *mt_n = dmixml_AddTextChild(mmt_n, "ModuleType", types[i]);
14501451
assert( mt_n != NULL );
1451-
dmixml_AddAttribute(mt_n, "index", "%i", i);
1452+
dmixml_AddAttribute(mt_n, "index", "%i", i+1);
14521453
}
14531454
}
14541455
}

src/pymap.xml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,38 @@
174174
</Map>
175175
</TypeMap>
176176

177-
<!-- FIXME : Type 05 : Memory Controller -->
177+
<!-- Type 05 : Memory Controller -->
178178
<TypeMap id="0x05">
179+
<Map rootpath="/dmidecode/MemoryCtrlInfo" keytype="string" key="@handle" valuetype="dict">
180+
<Map keytype="constant" key="dmi_type" valuetype="integer" value="@type"/>
181+
<Map keytype="constant" key="dmi_handle" valuetype="string" value="@handle"/>
182+
<Map keytype="constant" key="dmi_size" valuetype="integer" value="@size"/>
183+
<Map keytype="constant" key="data" valuetype="dict">
184+
<Map keytype="constant" key="Associated Memory Slots"
185+
valuetype="list:string" value="AssociatedMemorySlots/Slot"/>
186+
<Map keytype="constant" key="Current Interleave" valuetype="string" value="CurrentInterleave"/>
187+
<Map keytype="constant" key="Enabled Error Correcting Capabilities"
188+
valuetype="list:string" value="EnabledErrorCorrection/Capability"
189+
fixedsize="6" index_attr="index"/>
190+
<Map keytype="constant" key="Error Correcting Capabilities"
191+
valuetype="list:string" value="ErrorCorrection/Capabilities/Capability"
192+
fixedsize="6" index_attr="index"/>
193+
<Map keytype="constant" key="Error Detecting Method"
194+
valuetype="string" value="ErrorCorrection/CorrectionMethod"/>
195+
<Map keytype="constant" key="Maximum Memory Module Size"
196+
valuetype="string" value="concat(MaxMemoryModuleSize,' ',MaxMemoryModuleSize/@unit)"/>
197+
<Map keytype="constant" key="Maximum Total Memory Size"
198+
valuetype="string" value="concat(MaxTotalMemorySize,' ',MaxTotalMemorySize/@unit)"/>
199+
<Map rootpath="Voltages" keytype="constant" key="Memory Module Voltage" valuetype="dict">
200+
<Map keytype="string" key="Voltage/@key_compound" valuetype="boolean" value="Voltage/@available"/>
201+
</Map>
202+
<Map keytype="constant" key="Supported Interleave" valuetype="string" value="SupportedInterleave"/>
203+
<Map keytype="constant" key="Supported Memory Types"
204+
valuetype="list:string" value="SupportedTypes/ModuleType" fixedsize="11" index_attr="index"/>
205+
<Map keytype="constant" key="Supported Speeds"
206+
valuetype="list:string" value="SupportedSpeeds/Speed" emptyIsNone="1"/>
207+
</Map>
208+
</Map>
179209
</TypeMap>
180210

181211
<!-- FIXME : Type 06 : Memory Module -->

0 commit comments

Comments
 (0)