VirtualBox

儲存庫 vbox 的更動 44820


忽略:
時間撮記:
2013-2-25 下午02:45:13 (12 年 以前)
作者:
vboxsync
訊息:

BUGZ:6633 Expose OEM specific DMI table which contains TSC frequency value in kHz units provided by Time Manager; calculate number of DMI tables dynamically (no VBOX_DMI_TABLE_ENTR macro anymore).

位置:
trunk/src/VBox/Devices
檔案:
修改 7 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r44627 r44820  
    167167    /** The size of the DMI tables. */
    168168    uint16_t                cbDmiTables;
     169    /** Number of the DMI tables. */
     170    uint16_t                cNumDmiTables;
    169171    /** The DMI tables. */
    170172    uint8_t                 au8DMIPage[0x1000];
     
    14051407     * Plan some structures in RAM.
    14061408     */
    1407     FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->cbDmiTables);
     1409    FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->cbDmiTables, pThis->cNumDmiTables);
    14081410    if (pThis->u8IOAPIC)
    14091411        FwCommonPlantMpsFloatPtr(pDevIns);
     
    19251927    /** @todo XXX I wonder if we really need these tables as there is no SMBIOS header... */
    19261928    rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &pThis->aUuid,
    1927                                pDevIns->pCfg, pThis->cCpus, &pThis->cbDmiTables);
     1929                               pDevIns->pCfg, pThis->cCpus, &pThis->cbDmiTables, &pThis->cNumDmiTables);
    19281930    AssertRCReturn(rc, rc);
    19291931    if (pThis->u8IOAPIC)
  • trunk/src/VBox/Devices/PC/BIOS/smidmi.inc

    r43712 r44820  
    6666                dw      0               ; DMI tables length (set by DevPcBios)
    6767                dd      VBOX_DMI_TABLE_BASE ; DMI tables base
    68                 dw      VBOX_DMI_TABLE_ENTR ; DMI tables entries
     68                dw      0 ; DMI tables entries (set by DevPcBios)
    6969                db      VBOX_DMI_TABLE_VER ; DMI version
    7070                db      0               ; Just for alignment (16 bytes total)
  • trunk/src/VBox/Devices/PC/BIOS/vbdmismi.inc

    r43712 r44820  
    33VBOX_DMI_TABLE_BASE     equ     0E1000h
    44VBOX_DMI_TABLE_VER      equ     25h
    5 VBOX_DMI_TABLE_ENTR     equ     9
    65VBOX_DMI_TABLE_SIZE     equ     352
    76
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r44752 r44820  
    3535#include <iprt/system.h>
    3636
     37#include "vl_vbox.h"
    3738#include "VBoxDD.h"
    3839#include "VBoxDD2.h"
     
    240241AssertCompileSize(DMIOEMSTRINGS, 0x7);
    241242
     243/** DMI OEM-specific table (Type 128) */
     244typedef struct DMIOEMSPECIFIC
     245{
     246    DMIHDR          header;
     247    uint32_t        u32CpuFreqKHz;
     248} *PDMIOEMSPECIFIC;
     249AssertCompileSize(DMIOEMSPECIFIC, 0x8);
     250
    242251/** Physical memory array (Type 16) */
    243252typedef struct DMIRAMARRAY
     
    416425 *                              configuration string isn't present.
    417426 * @param   pCfg                The handle to our config node.
     427 * @param   cCpus               Number of VCPUs.
     428 * @param   pcbDmiTables        Size of DMI data in bytes.
     429 * @param   pcNumDmiTables      Number of DMI tables.
    418430 */
    419 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables)
     431int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables, uint16_t *pcNumDmiTables)
    420432{
    421433#define CHECKSIZE(cbWant) \
     
    869881        TERM_STRUCT;
    870882
     883        /*************************************
     884         * DMI OEM specific table (Type 128) *
     885         ************************************/
     886        PDMIOEMSPECIFIC pOEMSpecific = (PDMIOEMSPECIFIC)pszStr;
     887        CHECKSIZE(sizeof(*pOEMSpecific));
     888        START_STRUCT(pOEMSpecific);
     889        pOEMSpecific->header.u8Type    = 0x80; /* OEM specific */
     890        pOEMSpecific->header.u8Length  = sizeof(*pOEMSpecific);
     891        pOEMSpecific->header.u16Handle = 0x0008; /* Just next free handle */
     892        pOEMSpecific->u32CpuFreqKHz    = cpu_to_le32((uint32_t)((uint64_t)TMCpuTicksPerSecond(PDMDevHlpGetVM(pDevIns)) / 1000));
     893        TERM_STRUCT;
     894
    871895        /* End-of-table marker - includes padding to account for fixed table size. */
    872896        PDMIHDR pEndOfTable          = (PDMIHDR)pszStr;
     
    877901        pEndOfTable->u16Handle       = 0xFEFF;
    878902        *pcbDmiTables = ((uintptr_t)pszStr - (uintptr_t)pTable) + 2;
     903
     904        /* We currently plant 10 DMI tables. Update this if tables number changed. */
     905        *pcNumDmiTables = 10;
    879906
    880907        /* If more fields are added here, fix the size check in READCFGSTR */
     
    896923 * @param   pDevIns    The device instance data.
    897924 */
    898 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables)
     925void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables, uint16_t cNumDmiTables)
    899926{
    900927    struct
     
    922949            0,                                 // DMI tables length
    923950            VBOX_DMI_TABLE_BASE,               // DMI tables base
    924             VBOX_DMI_TABLE_ENTR,               // DMI tables entries
     951            0,                                 // DMI tables entries
    925952            VBOX_DMI_TABLE_VER,                // DMI version
    926953        }
     
    928955
    929956    aBiosHeaders.dmi.u16TablesLength = cbDmiTables;
     957    aBiosHeaders.dmi.u16TableEntries = cNumDmiTables;
    930958    aBiosHeaders.smbios.u8Checksum   = fwCommonChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios));
    931959    aBiosHeaders.dmi.u8Checksum      = fwCommonChecksum((uint8_t*)&aBiosHeaders.dmi,    sizeof(aBiosHeaders.dmi));
     
    933961    PDMDevHlpPhysWrite(pDevIns, 0xfe300, &aBiosHeaders, sizeof(aBiosHeaders));
    934962}
    935 AssertCompile(VBOX_DMI_TABLE_ENTR == 9);
    936963
    937964/**
  • trunk/src/VBox/Devices/PC/DevFwCommon.h

    r44529 r44820  
    2828
    2929/* Plant DMI table */
    30 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables);
    31 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables);
     30int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables, uint16_t *pcNumDmiTables);
     31void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables, uint16_t cNumDmiTables);
    3232
    3333/* Plant MPS table */
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r44706 r44820  
    3535#include <VBox/param.h>
    3636
     37#include "vl_vbox.h"
    3738#include "VBoxDD.h"
    3839#include "VBoxDD2.h"
     
    12431244    uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
    12441245    uint16_t cbDmiTables = 0;
     1246    uint16_t cNumDmiTables = 0;
    12451247    rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE,
    1246                                &uuid, pCfg, pThis->cCpus, &cbDmiTables);
     1248                               &uuid, pCfg, pThis->cCpus, &cbDmiTables, &cNumDmiTables);
    12471249    if (RT_FAILURE(rc))
    12481250        return rc;
     
    12581260            && *(uint16_t*)&pThis->pu8PcBios[i + 0x06] == 0)
    12591261        {
    1260             *(uint16_t*)&pThis->pu8PcBios[i + 0x06] = cbDmiTables;
     1262            *(uint16_t*)&pThis->pu8PcBios[i + 0x06] = cpu_to_le16(cbDmiTables);
     1263            *(uint16_t*)&pThis->pu8PcBios[i + 0x0C] = cpu_to_le16(cNumDmiTables);
    12611264            uint8_t u8Sum = 0;
    12621265            for (unsigned j = 0; j < pThis->cbPcBios; j++)
  • trunk/src/VBox/Devices/PC/DevPcBios.h

    r44528 r44820  
    2323#define VBOX_DMI_TABLE_VER          0x25
    2424
    25 /** define VBOX_DMI_TABLE_ENTR
    26  *
    27  * This is the number of DMI structures.
    28  */
    29 #define VBOX_DMI_TABLE_ENTR         9
    30 
    3125/** def VBOX_DMI_TABLE_SIZE
    3226 *
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette