1
0
forked from 0ad/0ad

smbios SystemSlot fix: add missing field, avoid displaying unknown device/function numbers

This was SVN commit r9199.
This commit is contained in:
janwas 2011-04-07 19:28:24 +00:00
parent c754c63376
commit b5c6868ac2
2 changed files with 7 additions and 2 deletions

View File

@ -286,8 +286,12 @@ void Fixup<Cache>(Cache& p)
template<>
void Fixup<SystemSlot>(SystemSlot& p)
{
p.functionNumber = bits(p.functionAndDeviceNumber, 0, 2);
p.deviceNumber = bits(p.functionAndDeviceNumber, 3, 7);
// (only initialize function and device numbers if functionAndDeviceNumber is valid)
if(p.functionAndDeviceNumber != 0xFF)
{
p.functionNumber = bits(p.functionAndDeviceNumber, 0, 2);
p.deviceNumber = bits(p.functionAndDeviceNumber, 3, 7);
}
}
template<>

View File

@ -661,6 +661,7 @@ struct Handle
FIELD(0, u16, id, "")\
FIELD(0, SystemSlotFlags1, flags1, "")\
FIELD(0, SystemSlotFlags2, flags2, "")\
FIELD(0, u16, segmentGroupNumber, "")\
FIELD(0, u8, busNumber, "")\
FIELD(F_INTERNAL, u8, functionAndDeviceNumber, "")\
FIELD(F_DERIVED, u8, deviceNumber, "")\