Changeset 25048 in vbox
- Timestamp:
- Nov 27, 2009 12:37:09 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r25025 r25048 909 909 uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid); 910 910 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 911 rc = sharedfwPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &uuid, pCfgHandle, true);911 rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &uuid, pCfgHandle, true /* fPutSmbiosHeaders */); 912 912 if (RT_FAILURE(rc)) 913 913 return rc; 914 914 915 sharedfwPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus);915 FwCommonPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus); 916 916 917 917 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, _4K, pThis->au8DMIPage, -
trunk/src/VBox/Devices/PC/DevFwCommon.cpp
r25025 r25048 1 1 /* $Id$ */ 2 2 /** @file 3 * Shared firmware code.3 * FwCommon - Shared firmware code (used by DevPcBios & DevEFI). 4 4 */ 5 5 … … 23 23 * Header Files * 24 24 *******************************************************************************/ 25 /** @todo: what should it be? */ 26 #define LOG_GROUP LOG_GROUP_DEV_PC_BIOS 25 #define LOG_GROUP LOG_GROUP_DEV 27 26 #include <VBox/pdmdev.h> 28 27 29 28 #include <VBox/log.h> 29 #include <VBox/err.h> 30 #include <VBox/param.h> 31 30 32 #include <iprt/assert.h> 31 #include <iprt/alloc.h>32 33 #include <iprt/buildconfig.h> 33 34 #include <iprt/file.h> 35 #include <iprt/mem.h> 34 36 #include <iprt/string.h> 35 37 #include <iprt/uuid.h> 36 #include <VBox/err.h>37 #include <VBox/param.h>38 38 39 39 #include "../Builtins.h" … … 41 41 #include "DevFwCommon.h" 42 42 43 44 /******************************************************************************* 45 * Structures and Typedefs * 46 *******************************************************************************/ 43 47 #pragma pack(1) 44 48 … … 258 262 * @param len size of data 259 263 */ 260 static uint8_t sharedfwChecksum(const uint8_t * const au8Data, uint32_t u32Length)264 static uint8_t fwCommonChecksum(const uint8_t * const au8Data, uint32_t u32Length) 261 265 { 262 266 uint8_t u8Sum = 0; … … 270 274 * 271 275 * @returns VBox status code. 272 * @param pDevIns The device instance. 273 * @param pTable Where to create the DMI table. 274 * @param cbMax The max size of the DMI table. 275 * @param pUuid Pointer to the UUID to use if the DmiUuid 276 * configuration string isn't present. 277 * @param pCfgHandle The handle to our config node. 276 * @param pDevIns The device instance. 277 * @param pTable Where to create the DMI table. 278 * @param cbMax The max size of the DMI table. 279 * @param pUuid Pointer to the UUID to use if the DmiUuid 280 * configuration string isn't present. 281 * @param pCfgHandle The handle to our config node. 282 * @param fPutSmbiosHeaders Plant SMBIOS headers if true. 278 283 */ 279 int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders)284 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders) 280 285 { 281 286 char *pszStr = (char *)pTable; … … 421 426 if (pszDmiSystemUuid) 422 427 { 423 intrc = RTUuidFromStr(&uuid, pszDmiSystemUuid);428 rc = RTUuidFromStr(&uuid, pszDmiSystemUuid); 424 429 if (RT_FAILURE(rc)) 425 430 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, … … 551 556 }; 552 557 553 aBiosHeaders.smbios.u8Checksum = sharedfwChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios));554 aBiosHeaders.dmi.u8Checksum = sharedfwChecksum((uint8_t*)&aBiosHeaders.dmi, sizeof(aBiosHeaders.dmi));558 aBiosHeaders.smbios.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios)); 559 aBiosHeaders.dmi.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.dmi, sizeof(aBiosHeaders.dmi)); 555 560 556 561 //Log(("Write SMBIOS\n")); … … 589 594 * @param addr physical address in guest memory. 590 595 */ 591 void sharedfwPlantMpsTable(PPDMDEVINS pDevIns, uint8_t *pTable, uint16_t numCpus)596 void FwCommonPlantMpsTable(PPDMDEVINS pDevIns, uint8_t *pTable, uint16_t cCpus) 592 597 { 593 598 /* configuration table */ … … 599 604 pCfgTab->u32OemTablePtr = 0; 600 605 pCfgTab->u16OemTableSize = 0; 601 pCfgTab->u16EntryCount = numCpus /* Processors */606 pCfgTab->u16EntryCount = cCpus /* Processors */ 602 607 + 1 /* ISA Bus */ 603 608 + 1 /* I/O-APIC */ … … 622 627 /* Construct MPS table for each VCPU. */ 623 628 PMPSPROCENTRY pProcEntry = (PMPSPROCENTRY)(pCfgTab+1); 624 for (int i = 0; i <numCpus; i++)629 for (int i = 0; i < cCpus; i++) 625 630 { 626 631 pProcEntry->u8EntryType = 0; /* processor entry */ … … 647 652 * ... At least one I/O APIC must be enabled." */ 648 653 PMPSIOAPICENTRY pIOAPICEntry = (PMPSIOAPICENTRY)(pBusEntry+1); 649 uint16_t apicId = numCpus;654 uint16_t apicId = cCpus; 650 655 pIOAPICEntry->u8EntryType = 2; /* I/O-APIC entry */ 651 656 pIOAPICEntry->u8Id = apicId; /* this ID is referenced by the interrupt entries */ … … 668 673 669 674 pCfgTab->u16Length = (uint8_t*)pIrqEntry - pTable; 670 pCfgTab->u8Checksum = sharedfwChecksum(pTable, pCfgTab->u16Length);675 pCfgTab->u8Checksum = fwCommonChecksum(pTable, pCfgTab->u16Length); 671 676 672 677 AssertMsg(pCfgTab->u16Length < 0x1000 - 0x100, … … 688 693 floatPtr.au8Feature[3] = 0; 689 694 floatPtr.au8Feature[4] = 0; 690 floatPtr.u8Checksum = sharedfwChecksum((uint8_t*)&floatPtr, 16);695 floatPtr.u8Checksum = fwCommonChecksum((uint8_t*)&floatPtr, 16); 691 696 PDMDevHlpPhysWrite (pDevIns, 0x9fff0, &floatPtr, 16); 692 697 } 698 -
trunk/src/VBox/Devices/PC/DevFwCommon.h
r25025 r25048 1 1 /* $Id$ */ 2 2 /** @file 3 * DevFwCommon - shared header for code common between different firmware types (EFI, BIOS).3 * FwCommon - Shared firmware code, header. 4 4 */ 5 5 … … 20 20 */ 21 21 22 #ifndef DEV_FWCOMMON_H23 #define DEV_FWCOMMON_H22 #ifndef ___PC_FwCommon_h 23 #define ___PC_FwCommon_h 24 24 25 25 #include "DevPcBios.h" … … 32 32 33 33 /* Plant DMI table */ 34 int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders = false);34 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders); 35 35 36 36 /* Plant MPS table */ 37 void sharedfwPlantMpsTable(PPDMDEVINS pDevIns, uint8_t *pTable, uint16_t numCpus);37 void FwCommonPlantMpsTable(PPDMDEVINS pDevIns, uint8_t *pTable, uint16_t cCpus); 38 38 39 39 #endif 40 -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r24706 r25048 747 747 748 748 if (pThis->u8IOAPIC) 749 sharedfwPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus);749 FwCommonPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus); 750 750 751 751 /* … … 1029 1029 uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid); 1030 1030 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 1031 rc = sharedfwPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &uuid, pCfgHandle);1031 rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &uuid, pCfgHandle, false /*fPutSmbiosHeaders*/); 1032 1032 if (RT_FAILURE(rc)) 1033 1033 return rc; 1034 1034 if (pThis->u8IOAPIC) 1035 sharedfwPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus);1035 FwCommonPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus); 1036 1036 1037 1037 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, _4K, pThis->au8DMIPage,
Note:
See TracChangeset
for help on using the changeset viewer.