Changeset 28569 in vbox
- Timestamp:
- Apr 21, 2010 4:52:24 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r28424 r28569 1012 1012 #endif 1013 1013 "DmiUseHostInfo\0" 1014 "DmiExposeAdditionalTables\0" 1014 1015 "64BitEntry\0" 1015 1016 "BootArgs\0" -
trunk/src/VBox/Devices/PC/DevFwCommon.cpp
r28568 r28569 476 476 #define START_STRUCT(tbl) \ 477 477 pszStr = (char *)(tbl + 1); \ 478 iStrNr = 1; 478 iStrNr = 1; 479 479 480 480 #define TERM_STRUCT \ … … 510 510 if (fDmiUseHostInfo) 511 511 fwCommonUseHostDMIStrings(); 512 513 uint8_t fDmiExposeAdditionalTables; 514 rc = CFGMR3QueryU8Def(pCfg, "DmiExposeAdditionalTables", &fDmiExposeAdditionalTables, 0); 515 if (RT_FAILURE (rc)) 516 return PDMDEV_SET_ERROR(pDevIns, rc, 517 N_("Configuration error: Failed to read \"DmiExposeAdditionalTables\"")); 512 518 513 519 for (;; fForceDefault = true, fHideErrors = false) … … 671 677 TERM_STRUCT; 672 678 673 674 /*************************************** 675 * DMI Physical Memory Array (Type 16) * 676 ***************************************/ 677 uint64_t u64RamSize; 678 rc = CFGMR3QueryU64(pCfg, "RamSize", &u64RamSize); 679 if (RT_FAILURE (rc)) 680 return PDMDEV_SET_ERROR(pDevIns, rc, 681 N_("Configuration error: Failed to read \"RamSize\"")); 682 683 PDMIRAMARRAY pMemArray = (PDMIRAMARRAY)pszStr; 684 CHECKSIZE(sizeof(*pMemArray)); 685 686 START_STRUCT(pMemArray); 687 pMemArray->header.u8Type = 16; /* Physical Memory Array */ 688 pMemArray->header.u8Length = sizeof(*pMemArray); 689 pMemArray->header.u16Handle = 0x0005; 690 pMemArray->u8Location = 0x03; /* Motherboard */ 691 pMemArray->u8Use = 0x03; /* System memory */ 692 pMemArray->u8MemErrorCorrection = 0x01; /* Other */ 693 uint32_t u32RamSizeK = (uint32_t)(u64RamSize / _1K); 694 pMemArray->u32MaxCapacity = u32RamSizeK; /* RAM size in K */ 695 pMemArray->u16MemErrorHandle = 0xfffe; /* No error info structure */ 696 pMemArray->u16NumberOfMemDevices = 1; 697 TERM_STRUCT; 698 699 /*************************************** 700 * DMI Memory Device (Type 17) * 701 ***************************************/ 702 PDMIMEMORYDEV pMemDev = (PDMIMEMORYDEV)pszStr; 703 CHECKSIZE(sizeof(*pMemDev)); 704 705 START_STRUCT(pMemDev); 706 pMemDev->header.u8Type = 17; /* Memory Device */ 707 pMemDev->header.u8Length = sizeof(*pMemDev); 708 pMemDev->header.u16Handle = 0x0006; 709 pMemDev->u16PhysMemArrayHandle = 0x0005; /* handle of array we belong to */ 710 pMemDev->u16MemErrHandle = 0xfffe; /* system doesn't provide this information */ 711 pMemDev->u16TotalWidth = 0xffff; /* Unknown */ 712 pMemDev->u16DataWidth = 0xffff; /* Unknown */ 713 int16_t u16RamSizeM = (uint16_t)(u64RamSize / _1M); 714 if (u16RamSizeM == 0) 715 u16RamSizeM = 0x400; /* 1G */ 716 pMemDev->u16Size = u16RamSizeM; /* RAM size */ 717 pMemDev->u8FormFactor = 0x09; /* DIMM */ 718 pMemDev->u8DeviceSet = 0x00; /* Not part of a device set */ 719 READCFGSTRDEF(pMemDev->u8DeviceLocator, " ", "DIMM 0"); 720 READCFGSTRDEF(pMemDev->u8BankLocator, " ", "Bank 0"); 721 pMemDev->u8MemoryType = 0x03; /* DRAM */ 722 pMemDev->u16TypeDetail = 0; /* Nothing special */ 723 pMemDev->u16Speed = 1600; /* Unknown, shall be speed in MHz */ 724 READCFGSTR(pMemDev->u8Manufacturer, DmiSystemVendor); 725 READCFGSTRDEF(pMemDev->u8SerialNumber, " ", "00000000"); 726 READCFGSTRDEF(pMemDev->u8AssetTag, " ", "00000000"); 727 READCFGSTRDEF(pMemDev->u8PartNumber, " ", "00000000"); 728 pMemDev->u8Attributes = 0; /* Unknown */ 729 TERM_STRUCT; 679 if (fDmiExposeAdditionalTables) 680 { 681 /*************************************** 682 * DMI Physical Memory Array (Type 16) * 683 ***************************************/ 684 uint64_t u64RamSize; 685 rc = CFGMR3QueryU64(pCfg, "RamSize", &u64RamSize); 686 if (RT_FAILURE (rc)) 687 return PDMDEV_SET_ERROR(pDevIns, rc, 688 N_("Configuration error: Failed to read \"RamSize\"")); 689 690 PDMIRAMARRAY pMemArray = (PDMIRAMARRAY)pszStr; 691 CHECKSIZE(sizeof(*pMemArray)); 692 693 START_STRUCT(pMemArray); 694 pMemArray->header.u8Type = 16; /* Physical Memory Array */ 695 pMemArray->header.u8Length = sizeof(*pMemArray); 696 pMemArray->header.u16Handle = 0x0005; 697 pMemArray->u8Location = 0x03; /* Motherboard */ 698 pMemArray->u8Use = 0x03; /* System memory */ 699 pMemArray->u8MemErrorCorrection = 0x01; /* Other */ 700 uint32_t u32RamSizeK = (uint32_t)(u64RamSize / _1K); 701 pMemArray->u32MaxCapacity = u32RamSizeK; /* RAM size in K */ 702 pMemArray->u16MemErrorHandle = 0xfffe; /* No error info structure */ 703 pMemArray->u16NumberOfMemDevices = 1; 704 TERM_STRUCT; 705 706 /*************************************** 707 * DMI Memory Device (Type 17) * 708 ***************************************/ 709 PDMIMEMORYDEV pMemDev = (PDMIMEMORYDEV)pszStr; 710 CHECKSIZE(sizeof(*pMemDev)); 711 712 START_STRUCT(pMemDev); 713 pMemDev->header.u8Type = 17; /* Memory Device */ 714 pMemDev->header.u8Length = sizeof(*pMemDev); 715 pMemDev->header.u16Handle = 0x0006; 716 pMemDev->u16PhysMemArrayHandle = 0x0005; /* handle of array we belong to */ 717 pMemDev->u16MemErrHandle = 0xfffe; /* system doesn't provide this information */ 718 pMemDev->u16TotalWidth = 0xffff; /* Unknown */ 719 pMemDev->u16DataWidth = 0xffff; /* Unknown */ 720 int16_t u16RamSizeM = (uint16_t)(u64RamSize / _1M); 721 if (u16RamSizeM == 0) 722 u16RamSizeM = 0x400; /* 1G */ 723 pMemDev->u16Size = u16RamSizeM; /* RAM size */ 724 pMemDev->u8FormFactor = 0x09; /* DIMM */ 725 pMemDev->u8DeviceSet = 0x00; /* Not part of a device set */ 726 READCFGSTRDEF(pMemDev->u8DeviceLocator, " ", "DIMM 0"); 727 READCFGSTRDEF(pMemDev->u8BankLocator, " ", "Bank 0"); 728 pMemDev->u8MemoryType = 0x03; /* DRAM */ 729 pMemDev->u16TypeDetail = 0; /* Nothing special */ 730 pMemDev->u16Speed = 1600; /* Unknown, shall be speed in MHz */ 731 READCFGSTR(pMemDev->u8Manufacturer, DmiSystemVendor); 732 READCFGSTRDEF(pMemDev->u8SerialNumber, " ", "00000000"); 733 READCFGSTRDEF(pMemDev->u8AssetTag, " ", "00000000"); 734 READCFGSTRDEF(pMemDev->u8PartNumber, " ", "00000000"); 735 pMemDev->u8Attributes = 0; /* Unknown */ 736 TERM_STRUCT; 737 } 730 738 731 739 /***************************** -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r28424 r28569 948 948 #endif 949 949 "DmiUseHostInfo\0" 950 "DmiExposeAdditionalTables\0" 950 951 )) 951 952 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28513 r28569 1026 1026 * EFI subtree. 1027 1027 */ 1028 rc = CFGMR3InsertNode(pDevices, "efi", &pDev); RC_CHECK();1029 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();1030 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();1031 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1032 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK();1033 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK();1034 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();1035 rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); RC_CHECK();1036 rc = CFGMR3InsertString(pCfg, "BootArgs", Utf8Str(bootArgs).raw()); RC_CHECK();1028 rc = CFGMR3InsertNode(pDevices, "efi", &pDev); RC_CHECK(); 1029 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 1030 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1031 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1032 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK(); 1033 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK(); 1034 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK(); 1035 rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); RC_CHECK(); 1036 rc = CFGMR3InsertString(pCfg, "BootArgs", Utf8Str(bootArgs).raw()); RC_CHECK(); 1037 1037 rc = CFGMR3InsertString(pCfg, "DeviceProps", Utf8Str(deviceProps).raw()); RC_CHECK(); 1038 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();1039 rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); RC_CHECK();1040 rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ RC_CHECK();1041 rc = CFGMR3InsertInteger(pCfg, "GopMode", u32GopMode); RC_CHECK();1042 rc = CFGMR3InsertInteger(pCfg, "UgaHorizontalResolution", u32UgaHorisontal); RC_CHECK();1043 rc = CFGMR3InsertInteger(pCfg, "UgaVerticalResolution", u32UgaVertical); RC_CHECK();1038 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 1039 rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); RC_CHECK(); 1040 rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ RC_CHECK(); 1041 rc = CFGMR3InsertInteger(pCfg, "GopMode", u32GopMode); RC_CHECK(); 1042 rc = CFGMR3InsertInteger(pCfg, "UgaHorizontalResolution", u32UgaHorisontal); RC_CHECK(); 1043 rc = CFGMR3InsertInteger(pCfg, "UgaVerticalResolution", u32UgaVertical); RC_CHECK(); 1044 1044 1045 1045 /* For OS X guests we'll force passing host's DMI info to the guest */ 1046 1046 if (fExtProfile) 1047 1047 { 1048 rc = CFGMR3InsertInteger(pCfg, "DmiUseHostInfo", 1); RC_CHECK(); 1048 rc = CFGMR3InsertInteger(pCfg, "DmiUseHostInfo", 1); RC_CHECK(); 1049 rc = CFGMR3InsertInteger(pCfg, "DmiExposeAdditionalTables", 1); RC_CHECK(); 1049 1050 } 1050 1051 }
Note:
See TracChangeset
for help on using the changeset viewer.