Changeset 81925 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 18, 2019 12:28:12 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134722
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevFwCommon.cpp
r81919 r81925 433 433 * @param cCpus Number of VCPUs. 434 434 * @param pcbDmiTables Size of DMI data in bytes. 435 * @param pc NumDmiTablesNumber of DMI tables.435 * @param pcDmiTables Number of DMI tables. 436 436 */ 437 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables, uint16_t *pcNumDmiTables) 437 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, 438 uint16_t *pcbDmiTables, uint16_t *pcDmiTables) 438 439 { 439 440 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; … … 938 939 939 940 /* We currently plant 10 DMI tables. Update this if tables number changed. */ 940 *pc NumDmiTables = 10;941 *pcDmiTables = 10; 941 942 942 943 /* If more fields are added here, fix the size check in DMI_READ_CFG_STR */ -
trunk/src/VBox/Devices/PC/DevFwCommon.h
r76565 r81925 25 25 26 26 /* Plant DMI table */ 27 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables, uint16_t *pcNumDmiTables); 27 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, 28 uint16_t *pcbDmiTables, uint16_t *pcDmiTables); 28 29 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint8_t *pHdr, uint16_t cbDmiTables, uint16_t cNumDmiTables); 29 30 -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r81920 r81925 1202 1202 return rc; 1203 1203 } 1204 1204 1205 1205 1206 /** … … 1609 1610 1610 1611 uint16_t cbDmiTables = 0; 1611 uint16_t c NumDmiTables = 0;1612 uint16_t cDmiTables = 0; 1612 1613 rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, 1613 &uuid, pCfg, pThis->cCpus, &cbDmiTables, &c NumDmiTables);1614 &uuid, pCfg, pThis->cCpus, &cbDmiTables, &cDmiTables); 1614 1615 if (RT_FAILURE(rc)) 1615 1616 return rc; 1616 1617 1617 1618 /* Look for _SM_/_DMI_ anchor strings within the BIOS and replace the table headers. */ 1618 for (unsigned i = 0; i < (pThis->cbPcBios - 16); i += 16) 1619 { 1620 if ( pThis->pu8PcBios[i + 0x00] == '_' 1621 && pThis->pu8PcBios[i + 0x01] == 'S' 1622 && pThis->pu8PcBios[i + 0x02] == 'M' 1623 && pThis->pu8PcBios[i + 0x03] == '_' 1624 && pThis->pu8PcBios[i + 0x10] == '_' 1625 && pThis->pu8PcBios[i + 0x11] == 'D' 1626 && pThis->pu8PcBios[i + 0x12] == 'M' 1627 && pThis->pu8PcBios[i + 0x13] == 'I' 1628 && pThis->pu8PcBios[i + 0x14] == '_') 1629 { 1630 FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->pu8PcBios + i, cbDmiTables, cNumDmiTables); 1619 unsigned offAnchor = ~0U; 1620 unsigned const cbToSearch = pThis->cbPcBios - 32; 1621 for (unsigned off = 0; off <= cbToSearch; off += 16) 1622 { 1623 if ( pThis->pu8PcBios[off + 0x00] != '_' 1624 || pThis->pu8PcBios[off + 0x01] != 'S' 1625 || pThis->pu8PcBios[off + 0x02] != 'M' 1626 || pThis->pu8PcBios[off + 0x03] != '_' 1627 || pThis->pu8PcBios[off + 0x10] != '_' 1628 || pThis->pu8PcBios[off + 0x11] != 'D' 1629 || pThis->pu8PcBios[off + 0x12] != 'M' 1630 || pThis->pu8PcBios[off + 0x13] != 'I' 1631 || pThis->pu8PcBios[off + 0x14] != '_') 1632 { /* likely */ } 1633 else 1634 { 1635 offAnchor = off; 1636 FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->pu8PcBios + off, cbDmiTables, cDmiTables); 1631 1637 break; 1632 1638 } 1633 1639 } 1640 AssertLogRel(offAnchor <= cbToSearch); 1634 1641 1635 1642 if (pThis->u8IOAPIC) … … 1832 1839 /* .uReserved0 = */ 0, 1833 1840 /* .szName = */ "pcbios", 1834 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS ,1841 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_NEW_STYLE, 1835 1842 /* .fClass = */ PDM_DEVREG_CLASS_ARCH_BIOS, 1836 1843 /* .cMaxInstances = */ 1,
Note:
See TracChangeset
for help on using the changeset viewer.