VirtualBox

vbox的更動 11193 路徑 trunk/src/VBox/Devices/Graphics


忽略:
時間撮記:
2008-8-6 下午07:30:52 (16 年 以前)
作者:
vboxsync
訊息:

DevVGA: Use CFGM*Def and be more strict about the config.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r11166 r11193  
    29122912    NOREF(pvUser);
    29132913    if (cb == 1)
    2914         vga_ioport_write(PDMINS2DATA(pDevIns, PVGASTATE), Port, u32);
     2914        vga_ioport_write(PDMINS_2_DATA(pDevIns, PVGASTATE), Port, u32);
    29152915    else if (cb == 2)
    29162916    {
    2917         vga_ioport_write(PDMINS2DATA(pDevIns, PVGASTATE), Port, u32 & 0xff);
    2918         vga_ioport_write(PDMINS2DATA(pDevIns, PVGASTATE), Port + 1, u32 >> 8);
     2917        vga_ioport_write(PDMINS_2_DATA(pDevIns, PVGASTATE), Port, u32 & 0xff);
     2918        vga_ioport_write(PDMINS_2_DATA(pDevIns, PVGASTATE), Port + 1, u32 >> 8);
    29192919    }
    29202920    return VINF_SUCCESS;
     
    29382938    if (cb == 1)
    29392939    {
    2940         *pu32 = vga_ioport_read(PDMINS2DATA(pDevIns, PVGASTATE), Port);
     2940        *pu32 = vga_ioport_read(PDMINS_2_DATA(pDevIns, PVGASTATE), Port);
    29412941        return VINF_SUCCESS;
    29422942    }
    29432943    else if (cb == 2)
    29442944    {
    2945         *pu32 = vga_ioport_read(PDMINS2DATA(pDevIns, PVGASTATE), Port)
    2946              | (vga_ioport_read(PDMINS2DATA(pDevIns, PVGASTATE), Port + 1) << 8);
     2945        *pu32 = vga_ioport_read(PDMINS_2_DATA(pDevIns, PVGASTATE), Port)
     2946             | (vga_ioport_read(PDMINS_2_DATA(pDevIns, PVGASTATE), Port + 1) << 8);
    29472947        return VINF_SUCCESS;
    29482948    }
     
    29642964PDMBOTHCBDECL(int) vgaIOPortWriteVBEData(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    29652965{
    2966     VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     2966    VGAState *s = PDMINS_2_DATA(pDevIns, PVGASTATE);
    29672967
    29682968    NOREF(pvUser);
     
    30453045    if (cb == 1)
    30463046    {
    3047         VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     3047        VGAState *s = PDMINS_2_DATA(pDevIns, PVGASTATE);
    30483048        if (!s->fWriteVBEIndex)
    30493049        {
     
    30623062#endif
    30633063    if (cb == 2)
    3064         vbe_ioport_write_index(PDMINS2DATA(pDevIns, PVGASTATE), Port, u32);
     3064        vbe_ioport_write_index(PDMINS_2_DATA(pDevIns, PVGASTATE), Port, u32);
    30653065    else
    30663066        AssertMsgFailed(("vgaIOPortWriteVBEIndex: Port=%#x cb=%d u32=%#x\n", Port, cb, u32));
     
    30863086    if (cb == 1)
    30873087    {
    3088         VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     3088        VGAState *s = PDMINS_2_DATA(pDevIns, PVGASTATE);
    30893089
    30903090        if (!s->fReadVBEData)
     
    31053105    if (cb == 2)
    31063106    {
    3107         *pu32 = vbe_ioport_read_data(PDMINS2DATA(pDevIns, PVGASTATE), Port);
     3107        *pu32 = vbe_ioport_read_data(PDMINS_2_DATA(pDevIns, PVGASTATE), Port);
    31083108        return VINF_SUCCESS;
    31093109    }
    31103110    else if (cb == 4)
    31113111    {
    3112         VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     3112        VGAState *s = PDMINS_2_DATA(pDevIns, PVGASTATE);
    31133113        /* Quick hack for getting the vram size. */
    31143114        *pu32 = s->vram_size;
     
    31373137    if (cb == 1)
    31383138    {
    3139         VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     3139        VGAState *s = PDMINS_2_DATA(pDevIns, PVGASTATE);
    31403140
    31413141        if (!s->fReadVBEIndex)
     
    31563156    if (cb == 2)
    31573157    {
    3158         *pu32 = vbe_ioport_read_index(PDMINS2DATA(pDevIns, PVGASTATE), Port);
     3158        *pu32 = vbe_ioport_read_index(PDMINS_2_DATA(pDevIns, PVGASTATE), Port);
    31593159        return VINF_SUCCESS;
    31603160    }
     
    32113211PDMBOTHCBDECL(int) vgaMMIOFill(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, uint32_t u32Item, unsigned cbItem, unsigned cItems)
    32123212{
    3213     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     3213    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    32143214    uint32_t b;
    32153215    uint32_t write_mask, bit_mask, set_mask;
     
    34183418PDMBOTHCBDECL(int) vgaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
    34193419{
    3420     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     3420    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    34213421    STAM_PROFILE_START(&pData->StatGCMemoryRead, a);
    34223422    NOREF(pvUser);
     
    34703470PDMBOTHCBDECL(int) vgaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
    34713471{
    3472     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     3472    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    34733473    uint8_t  *pu8 = (uint8_t *)pv;
    34743474    int rc = VINF_SUCCESS;
     
    35583558     */
    35593559    rc = PGMHandlerPhysicalPageTempOff(pVM, pData->GCPhysVRAM, GCPhys);
    3560     if (VBOX_SUCCESS(rc))
     3560    if (RT_SUCCESS(rc))
    35613561    {
    35623562#ifndef IN_RING3
    35633563        rc = PGMShwModifyPage(pVM, GCPtr, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW);
    3564         if (VBOX_SUCCESS(rc))
     3564        if (RT_SUCCESS(rc))
    35653565            return VINF_SUCCESS;
    35663566        else
     
    36453645    Assert(GCPhys >= pData->GCPhysVRAM);
    36463646    rc = vgaLFBAccess(pVM, pData, GCPhys, 0);
    3647     if (VBOX_SUCCESS(rc))
     3647    if (RT_SUCCESS(rc))
    36483648        return VINF_PGM_HANDLER_DO_DEFAULT;
    36493649    AssertMsg(rc <= VINF_SUCCESS, ("rc=%Vrc\n", rc));
     
    36713671PDMBOTHCBDECL(int) vbeIOPortWriteVBEExtra(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    36723672{
    3673     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     3673    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    36743674    NOREF(pvUser);
    36753675    NOREF(Port);
     
    37003700PDMBOTHCBDECL(int) vbeIOPortReadVBEExtra(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    37013701{
    3702     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     3702    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    37033703    NOREF(pvUser);
    37043704    NOREF(Port);
     
    40204020PDMBOTHCBDECL(int) vbeIOPortWriteCMDLogo(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    40214021{
    4022     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     4022    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    40234023    NOREF(pvUser);
    40244024    NOREF(Port);
     
    41294129PDMBOTHCBDECL(int) vbeIOPortReadCMDLogo(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    41304130{
    4131     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     4131    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    41324132    NOREF(pvUser);
    41334133    NOREF(Port);
     
    45554555                break;
    45564556        }
    4557         if (VBOX_SUCCESS(rc))
     4557        if (RT_SUCCESS(rc))
    45584558        {
    45594559            /*
     
    47504750static DECLCALLBACK(void) vgaTimerRefresh(PPDMDEVINS pDevIns, PTMTIMER pTimer)
    47514751{
    4752     PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     4752    PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    47534753    if (pData->pDrv)
    47544754        pData->pDrv->pfnRefresh(pData->pDrv);
     
    47754775    int         rc;
    47764776    PPDMDEVINS  pDevIns = pPciDev->pDevIns;
    4777     PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
     4777    PVGASTATE   pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    47784778    LogFlow(("vgaR3IORegionMap: iRegion=%d GCPhysAddress=%VGp cb=%#x enmType=%d\n", iRegion, GCPhysAddress, cb, enmType));
    47794779    AssertReturn(iRegion == 0 && enmType == PCI_ADDRESS_SPACE_MEM_PREFETCH, VERR_INTERNAL_ERROR);
     
    48264826static DECLCALLBACK(int) vgaR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
    48274827{
    4828     vga_save(pSSMHandle, PDMINS2DATA(pDevIns, PVGASTATE));
     4828    vga_save(pSSMHandle, PDMINS_2_DATA(pDevIns, PVGASTATE));
    48294829    return VINF_SUCCESS;
    48304830}
     
    48414841static DECLCALLBACK(int) vgaR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
    48424842{
    4843     if (vga_load(pSSMHandle, PDMINS2DATA(pDevIns, PVGASTATE), u32Version))
     4843    if (vga_load(pSSMHandle, PDMINS_2_DATA(pDevIns, PVGASTATE), u32Version))
    48444844        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    48454845    return VINF_SUCCESS;
     
    48574857static DECLCALLBACK(void)  vgaR3Reset(PPDMDEVINS pDevIns)
    48584858{
    4859     PVGASTATE       pData = PDMINS2DATA(pDevIns, PVGASTATE);
     4859    PVGASTATE       pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    48604860    char           *pchStart;
    48614861    char           *pchEnd;
     
    50105010    if (offDelta)
    50115011    {
    5012         PVGASTATE pData = PDMINS2DATA(pDevIns, PVGASTATE);
     5012        PVGASTATE pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    50135013        LogFlow(("vgaRelocate: offDelta = %08X\n", offDelta));
    50145014
     
    50355035static DECLCALLBACK(int)  vgaAttach(PPDMDEVINS pDevIns, unsigned iLUN)
    50365036{
    5037     PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
     5037    PVGASTATE   pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    50385038    switch (iLUN)
    50395039    {
     
    50425042        {
    50435043            int rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pData->Base, &pData->pDrvBase, "Display Port");
    5044             if (VBOX_SUCCESS(rc))
     5044            if (RT_SUCCESS(rc))
    50455045            {
    50465046                pData->pDrv = (PDMIDISPLAYCONNECTOR*)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_DISPLAY_CONNECTOR);
     
    50755075            }
    50765076            else
    5077                 AssertMsgFailed(("Failed to attach LUN #0! rc=%Vrc\n", rc));
     5077                AssertLogRelMsgFailed(("Failed to attach LUN #0! rc=%Vrc\n", rc));
    50785078            return rc;
    50795079        }
     
    51025102     * Reset the interfaces and update the controller state.
    51035103     */
    5104     PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
     5104    PVGASTATE   pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    51055105    switch (iLUN)
    51065106    {
     
    51385138    int         rc;
    51395139    unsigned i;
    5140     PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
     5140    PVGASTATE   pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    51415141    PVM         pVM = PDMDevHlpGetVM(pDevIns);
    51425142#ifdef VBE_NEW_DYN_LIST
     
    51945194     * Init state data.
    51955195     */
    5196     rc = CFGMR3QueryU32(pCfgHandle, "VRamSize", &pData->vram_size);
    5197     if (VBOX_FAILURE(rc) || !pData->vram_size)
    5198         pData->vram_size = VGA_VRAM_DEFAULT;
    5199     else if (pData->vram_size > VGA_VRAM_MAX)
    5200     {
    5201         AssertMsgFailed(("vram_size=%d max=%d\n", pData->vram_size, VGA_VRAM_MAX));
    5202         pData->vram_size = VGA_VRAM_MAX;
    5203     }
    5204     else if (pData->vram_size < VGA_VRAM_MIN)
    5205     {
    5206         AssertMsgFailed(("vram_size=%d min=%d\n", pData->vram_size, VGA_VRAM_MIN));
    5207         pData->vram_size = RT_ALIGN_32(pData->vram_size, _1M);
    5208     }
    5209     Log(("VGA: VRamSize=%#x\n", pData->vram_size));
    5210 
    5211     pData->fGCEnabled = true;
    5212     rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &f);
    5213     if (VBOX_SUCCESS(rc) && !f)
    5214         pData->fGCEnabled = false;
     5196    rc = CFGMR3QueryU32Def(pCfgHandle, "VRamSize", &pData->vram_size, VGA_VRAM_DEFAULT);
     5197    AssertLogRelRCReturn(rc, rc);
     5198    if (pData->vram_size > VGA_VRAM_MAX)
     5199        return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS,
     5200                                   "VRamSize is too large, %#x, max %#x", pData->vram_size, VGA_VRAM_MAX);
     5201    if (pData->vram_size < VGA_VRAM_MIN)
     5202        return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS,
     5203                                   "VRamSize is too small, %#x, max %#x", pData->vram_size, VGA_VRAM_MIN);
     5204
     5205    rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &f, true);
     5206    AssertLogRelRCReturn(rc, rc);
    52155207    Log(("VGA: fGCEnabled=%d\n", pData->fGCEnabled));
    52165208
    5217     pData->fR0Enabled = true;
    5218     rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &f);
    5219     if (VBOX_SUCCESS(rc) && !f)
    5220         pData->fR0Enabled = false;
    5221     Log(("VGA: fR0Enabled=%d\n", pData->fR0Enabled));
     5209    rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &f, true);
     5210    AssertLogRelRCReturn(rc, rc);
     5211    Log(("VGA: VRamSize=%#x fGCenabled=%RTbool fR0Enabled=%RTbool\n", pData->vram_size, pData->fGCEnabled, pData->fR0Enabled));
    52225212
    52235213    pData->pDevInsR3 = pDevIns;
     
    52285218
    52295219    /* The PCI devices configuration. */
    5230     pData->Dev.config[0x00] = 0xee;              /* PCI vendor, just a free bogus value */
    5231     pData->Dev.config[0x01] = 0x80;
    5232 
    5233     pData->Dev.config[0x02] = 0xef;              /* Device ID */
    5234     pData->Dev.config[0x03] = 0xbe;
    5235 
    5236     pData->Dev.config[0x0a] = 0x00;              /* VGA controller */
    5237     pData->Dev.config[0x0b] = 0x03;
    5238     pData->Dev.config[0x0e] = 0x00;              /* header_type */
     5220    PCIDevSetVendorId(  &pData->Dev, 0x80ee);   /* PCI vendor, just a free bogus value */
     5221    PCIDevSetDeviceId(  &pData->Dev, 0xbeef);
     5222    PCIDevSetClassSub(  &pData->Dev,   0x00);   /* VGA controller */
     5223    PCIDevSetClassBase( &pData->Dev,   0x03);
     5224    PCIDevSetHeaderType(&pData->Dev,   0x00);
    52395225
    52405226    /* The LBF access handler - error handling is better here than in the map function.  */
    52415227    rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, "vgaGCLFBAccessHandler", &pData->RCPtrLFBHandler);
    5242     if (VBOX_FAILURE(rc))
     5228    if (RT_FAILURE(rc))
    52435229    {
    52445230        AssertReleaseMsgFailed(("PDMR3GetSymbolGC(, %s, \"vgaGCLFBAccessHandler\",) -> %Vrc\n", pDevIns->pDevReg->szGCMod, rc));
     
    52635249     */
    52645250    rc = PDMDevHlpMMIO2Register(pDevIns, 0 /* iRegion */, pData->vram_size, 0, (void **)&pData->vram_ptrR3, "VRam");
    5265     AssertMsgRC(rc, ("PDMDevHlpMMIO2Register(%#x,) -> %Rrc\n", pData->vram_size, rc));
     5251    AssertLogRelMsgRCReturn(rc, ("PDMDevHlpMMIO2Register(%#x,) -> %Rrc\n", pData->vram_size, rc), rc);
    52665252    pData->vram_ptrR0 = (RTR0PTR)pData->vram_ptrR3; /** @todo #1865 Map parts into R0 or just use PGM access (Mac only). */
    52675253
    52685254    RTRCPTR pRCMapping = 0;
    52695255    rc = PDMDevHlpMMHyperMapMMIO2(pDevIns, 0 /* iRegion */, 0 /* off */,  VGA_MAPPING_SIZE, "VGA VRam", &pRCMapping);
    5270     AssertMsgRC(rc, ("MMR3HyperMapGCPhys(%#x,) -> %Rrc\n", pData->vram_size, rc));
     5256    AssertLogRelMsgRCReturn(rc, ("PDMDevHlpMMHyperMapMMIO2(%#x,) -> %Rrc\n", pData->vram_size, rc), rc);
    52715257    pData->vram_ptrRC = pRCMapping;
    52725258
     
    52755261     */
    52765262    rc = PDMDevHlpIOPortRegister(pDevIns,  0x3c0, 16, NULL, vgaIOPortWrite,       vgaIOPortRead, NULL, NULL,      "VGA - 3c0");
    5277     if (VBOX_FAILURE(rc))
     5263    if (RT_FAILURE(rc))
    52785264        return rc;
    52795265    rc = PDMDevHlpIOPortRegister(pDevIns,  0x3b4,  2, NULL, vgaIOPortWrite,       vgaIOPortRead, NULL, NULL,      "VGA - 3b4");
    5280     if (VBOX_FAILURE(rc))
     5266    if (RT_FAILURE(rc))
    52815267        return rc;
    52825268    rc = PDMDevHlpIOPortRegister(pDevIns,  0x3ba,  1, NULL, vgaIOPortWrite,       vgaIOPortRead, NULL, NULL,      "VGA - 3ba");
    5283     if (VBOX_FAILURE(rc))
     5269    if (RT_FAILURE(rc))
    52845270        return rc;
    52855271    rc = PDMDevHlpIOPortRegister(pDevIns,  0x3d4,  2, NULL, vgaIOPortWrite,       vgaIOPortRead, NULL, NULL,      "VGA - 3d4");
    5286     if (VBOX_FAILURE(rc))
     5272    if (RT_FAILURE(rc))
    52875273        return rc;
    52885274    rc = PDMDevHlpIOPortRegister(pDevIns,  0x3da,  1, NULL, vgaIOPortWrite,       vgaIOPortRead, NULL, NULL,      "VGA - 3da");
    5289     if (VBOX_FAILURE(rc))
     5275    if (RT_FAILURE(rc))
    52905276        return rc;
    52915277
    52925278#ifdef CONFIG_BOCHS_VBE
    52935279    rc = PDMDevHlpIOPortRegister(pDevIns,  0x1ce,  1, NULL, vgaIOPortWriteVBEIndex, vgaIOPortReadVBEIndex, NULL, NULL, "VGA/VBE - Index");
    5294     if (VBOX_FAILURE(rc))
     5280    if (RT_FAILURE(rc))
    52955281        return rc;
    52965282    rc = PDMDevHlpIOPortRegister(pDevIns,  0x1cf,  1, NULL, vgaIOPortWriteVBEData, vgaIOPortReadVBEData, NULL, NULL, "VGA/VBE - Data");
    5297     if (VBOX_FAILURE(rc))
     5283    if (RT_FAILURE(rc))
    52985284        return rc;
    52995285#if 0
     
    53025288    /* Old Bochs. */
    53035289    rc = PDMDevHlpIOPortRegister(pDevIns, 0xff80,  1, NULL, vgaIOPortWriteVBEIndex, vgaIOPortReadVBEIndex, "VGA/VBE - Index Old");
    5304     if (VBOX_FAILURE(rc))
     5290    if (RT_FAILURE(rc))
    53055291        return rc;
    53065292    rc = PDMDevHlpIOPortRegister(pDevIns, 0xff81,  1, NULL, vgaIOPortWriteVBEData, vgaIOPortReadVBEData, "VGA/VBE - Data Old");
    5307     if (VBOX_FAILURE(rc))
     5293    if (RT_FAILURE(rc))
    53085294        return rc;
    53095295#endif
     
    53145300    {
    53155301        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x3c0, 16, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3c0 (GC)");
    5316         if (VBOX_FAILURE(rc))
     5302        if (RT_FAILURE(rc))
    53175303            return rc;
    53185304        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x3b4,  2, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3b4 (GC)");
    5319         if (VBOX_FAILURE(rc))
     5305        if (RT_FAILURE(rc))
    53205306            return rc;
    53215307        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x3ba,  1, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3ba (GC)");
    5322         if (VBOX_FAILURE(rc))
     5308        if (RT_FAILURE(rc))
    53235309            return rc;
    53245310        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x3d4,  2, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3d4 (GC)");
    5325         if (VBOX_FAILURE(rc))
     5311        if (RT_FAILURE(rc))
    53265312            return rc;
    53275313        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x3da,  1, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3da (GC)");
    5328         if (VBOX_FAILURE(rc))
     5314        if (RT_FAILURE(rc))
    53295315            return rc;
    53305316#ifdef CONFIG_BOCHS_VBE
    53315317        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x1ce,  1, 0, "vgaIOPortWriteVBEIndex", "vgaIOPortReadVBEIndex", NULL, NULL, "VGA/VBE - Index (GC)");
    5332         if (VBOX_FAILURE(rc))
     5318        if (RT_FAILURE(rc))
    53335319            return rc;
    53345320        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x1cf,  1, 0, "vgaIOPortWriteVBEData", "vgaIOPortReadVBEData", NULL, NULL, "VGA/VBE - Data (GC)");
    5335         if (VBOX_FAILURE(rc))
     5321        if (RT_FAILURE(rc))
    53365322            return rc;
    53375323
     
    53415327        /* Old Bochs. */
    53425328        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0xff80,  1, 0, "vgaIOPortWriteVBEIndex", "vgaIOPortReadVBEIndex", "VGA/VBE - Index Old (GC)");
    5343         if (VBOX_FAILURE(rc))
     5329        if (RT_FAILURE(rc))
    53445330            return rc;
    53455331        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0xff81,  1, 0, "vgaIOPortWriteVBEData", "vgaIOPortReadVBEData", "VGA/VBE - Index Old (GC)");
    5346         if (VBOX_FAILURE(rc))
     5332        if (RT_FAILURE(rc))
    53475333            return rc;
    53485334#endif
     
    53555341    {
    53565342        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x3c0, 16, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3c0 (GC)");
    5357         if (VBOX_FAILURE(rc))
     5343        if (RT_FAILURE(rc))
    53585344            return rc;
    53595345        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x3b4,  2, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3b4 (GC)");
    5360         if (VBOX_FAILURE(rc))
     5346        if (RT_FAILURE(rc))
    53615347            return rc;
    53625348        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x3ba,  1, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3ba (GC)");
    5363         if (VBOX_FAILURE(rc))
     5349        if (RT_FAILURE(rc))
    53645350            return rc;
    53655351        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x3d4,  2, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3d4 (GC)");
    5366         if (VBOX_FAILURE(rc))
     5352        if (RT_FAILURE(rc))
    53675353            return rc;
    53685354        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x3da,  1, 0, "vgaIOPortWrite",       "vgaIOPortRead", NULL, NULL,     "VGA - 3da (GC)");
    5369         if (VBOX_FAILURE(rc))
     5355        if (RT_FAILURE(rc))
    53705356            return rc;
    53715357#ifdef CONFIG_BOCHS_VBE
    53725358        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x1ce,  1, 0, "vgaIOPortWriteVBEIndex", "vgaIOPortReadVBEIndex", NULL, NULL, "VGA/VBE - Index (GC)");
    5373         if (VBOX_FAILURE(rc))
     5359        if (RT_FAILURE(rc))
    53745360            return rc;
    53755361        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x1cf,  1, 0, "vgaIOPortWriteVBEData", "vgaIOPortReadVBEData", NULL, NULL, "VGA/VBE - Data (GC)");
    5376         if (VBOX_FAILURE(rc))
     5362        if (RT_FAILURE(rc))
    53775363            return rc;
    53785364
     
    53825368        /* Old Bochs. */
    53835369        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0xff80,  1, 0, "vgaIOPortWriteVBEIndex", "vgaIOPortReadVBEIndex", "VGA/VBE - Index Old (GC)");
    5384         if (VBOX_FAILURE(rc))
     5370        if (RT_FAILURE(rc))
    53855371            return rc;
    53865372        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0xff81,  1, 0, "vgaIOPortWriteVBEData", "vgaIOPortReadVBEData", "VGA/VBE - Index Old (GC)");
    5387         if (VBOX_FAILURE(rc))
     5373        if (RT_FAILURE(rc))
    53885374            return rc;
    53895375#endif
     
    53945380    /* vga mmio */
    53955381    rc = PDMDevHlpMMIORegister(pDevIns, 0x000a0000, 0x00020000, 0, vgaMMIOWrite, vgaMMIORead, vgaMMIOFill, "VGA - VGA Video Buffer");
    5396     if (VBOX_FAILURE(rc))
     5382    if (RT_FAILURE(rc))
    53975383        return rc;
    53985384    if (pData->fGCEnabled)
    53995385    {
    54005386        rc = PDMDevHlpMMIORegisterGC(pDevIns, 0x000a0000, 0x00020000, 0, "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    5401         if (VBOX_FAILURE(rc))
     5387        if (RT_FAILURE(rc))
    54025388            return rc;
    54035389    }
     
    54055391    {
    54065392        rc = PDMDevHlpMMIORegisterR0(pDevIns, 0x000a0000, 0x00020000, 0, "vgaMMIOWrite", "vgaMMIORead", "vgaMMIOFill");
    5407         if (VBOX_FAILURE(rc))
     5393        if (RT_FAILURE(rc))
    54085394            return rc;
    54095395    }
     
    54115397    /* vga bios */
    54125398    rc = PDMDevHlpIOPortRegister(pDevIns, VBE_PRINTF_PORT, 1, NULL, vgaIOPortWriteBIOS, vgaIOPortReadBIOS, NULL, NULL, "VGA BIOS debug/panic");
    5413     if (VBOX_FAILURE(rc))
     5399    if (RT_FAILURE(rc))
    54145400        return rc;
    54155401    AssertReleaseMsg(g_cbVgaBiosBinary <= _64K && g_cbVgaBiosBinary >= 32*_1K, ("g_cbVgaBiosBinary=%#x\n", g_cbVgaBiosBinary));
     
    54175403    rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, g_cbVgaBiosBinary, &g_abVgaBiosBinary[0],
    54185404                              false /* fShadow */, "VGA BIOS");
    5419     if (VBOX_FAILURE(rc))
     5405    if (RT_FAILURE(rc))
    54205406        return rc;
    54215407
     
    54245410                                          NULL, vgaR3SaveExec, NULL,
    54255411                                          NULL, vgaR3LoadExec, NULL);
    5426     if (VBOX_FAILURE(rc))
     5412    if (RT_FAILURE(rc))
    54275413        return rc;
    54285414
    54295415    /* PCI */
    54305416    rc = PDMDevHlpPCIRegister(pDevIns, &pData->Dev);
    5431     if (VBOX_FAILURE(rc))
     5417    if (RT_FAILURE(rc))
    54325418        return rc;
    54335419    /*AssertMsg(pData->Dev.devfn == 16 || iInstance != 0, ("pData->Dev.devfn=%d\n", pData->Dev.devfn));*/
     
    54365422
    54375423    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0 /* iRegion */, pData->vram_size, PCI_ADDRESS_SPACE_MEM_PREFETCH, vgaR3IORegionMap);
    5438     if (VBOX_FAILURE(rc))
     5424    if (RT_FAILURE(rc))
    54395425        return rc;
    54405426
     
    54435429     */
    54445430    rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_REAL, vgaTimerRefresh, "VGA Refresh Timer", &pData->RefreshTimer);
    5445     if (VBOX_FAILURE(rc))
     5431    if (RT_FAILURE(rc))
    54465432        return rc;
    54475433
     
    54505436     */
    54515437    rc = vgaAttach(pDevIns, 0 /* display LUN # */);
    5452     if (VBOX_FAILURE(rc))
     5438    if (RT_FAILURE(rc))
    54535439        return rc;
    54545440
     
    54605446
    54615447    rc = CFGMR3QueryU32(pCfgHandle, "HeightReduction", &cyReduction);
    5462     if (VBOX_SUCCESS(rc) && cyReduction)
     5448    if (RT_SUCCESS(rc) && cyReduction)
    54635449        cb *= 2;                            /* Default mode list will be twice long */
    54645450    else
     
    54665452
    54675453    rc = CFGMR3QueryU32(pCfgHandle, "CustomVideoModes", &cCustomModes);
    5468     if (VBOX_SUCCESS(rc) && cCustomModes)
     5454    if (RT_SUCCESS(rc) && cCustomModes)
    54695455        cb += sizeof(ModeInfoListItem) * cCustomModes;
    54705456    else
     
    55535539            RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%d", i);
    55545540            rc = CFGMR3QueryStringAlloc(pCfgHandle, szExtraDataKey, &pszExtraData);
    5555             if (VBOX_SUCCESS(rc))
     5541            if (RT_SUCCESS(rc))
    55565542            {
    55575543                ModeInfoListItem *pDefMode = mode_info_list;
     
    56475633     */
    56485634    rc = PDMDevHlpIOPortRegister(pDevIns, VBE_EXTRA_PORT, 1, NULL, vbeIOPortWriteVBEExtra, vbeIOPortReadVBEExtra, NULL, NULL, "VBE BIOS Extra Data");
    5649     if (VBOX_FAILURE(rc))
     5635    if (RT_FAILURE(rc))
    56505636        return rc;
    56515637#endif
     
    56555641     */
    56565642    rc = PDMDevHlpIOPortRegister(pDevIns, LOGO_IO_PORT, 1, NULL, vbeIOPortWriteCMDLogo, vbeIOPortReadCMDLogo, NULL, NULL, "BIOS Logo");
    5657     if (VBOX_FAILURE(rc))
     5643    if (RT_FAILURE(rc))
    56585644        return rc;
    56595645
     
    56665652    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    56675653        LogoHdr.fu8FadeIn = 1;
    5668     else if (VBOX_FAILURE(rc))
     5654    else if (RT_FAILURE(rc))
    56695655        return PDMDEV_SET_ERROR(pDevIns, rc,
    56705656                                N_("Configuration error: Querying \"FadeIn\" as integer failed"));
     
    56735659    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    56745660        LogoHdr.fu8FadeOut = 1;
    5675     else if (VBOX_FAILURE(rc))
     5661    else if (RT_FAILURE(rc))
    56765662        return PDMDEV_SET_ERROR(pDevIns, rc,
    56775663                                N_("Configuration error: Querying \"FadeOut\" as integer failed"));
     
    56805666    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    56815667        LogoHdr.u16LogoMillies = 0;
    5682     else if (VBOX_FAILURE(rc))
     5668    else if (RT_FAILURE(rc))
    56835669        return PDMDEV_SET_ERROR(pDevIns, rc,
    56845670                                N_("Configuration error: Querying \"LogoTime\" as integer failed"));
     
    56915677    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    56925678        LogoHdr.fu8ShowBootMenu = 0;
    5693     else if (VBOX_FAILURE(rc))
     5679    else if (RT_FAILURE(rc))
    56945680        return PDMDEV_SET_ERROR(pDevIns, rc,
    56955681                                N_("Configuration error: Querying \"ShowBootMenu\" as integer failed"));
     
    57015687    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    57025688        pData->pszLogoFile = NULL;
    5703     else if (VBOX_FAILURE(rc))
     5689    else if (RT_FAILURE(rc))
    57045690        return PDMDEV_SET_ERROR(pDevIns, rc,
    57055691                                N_("Configuration error: Querying \"LogoFile\" as a string failed"));
     
    57195705        rc = RTFileOpen(&FileLogo, pData->pszLogoFile,
    57205706                        RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
    5721         if (VBOX_SUCCESS(rc))
     5707        if (RT_SUCCESS(rc))
    57225708        {
    57235709            uint64_t cbFile;
    57245710            rc = RTFileGetSize(FileLogo, &cbFile);
    5725             if (VBOX_SUCCESS(rc))
     5711            if (RT_SUCCESS(rc))
    57265712            {
    57275713                if (cbFile > 0 && cbFile < 32*_1M)
     
    57315717            }
    57325718        }
    5733         if (VBOX_FAILURE(rc))
     5719        if (RT_FAILURE(rc))
    57345720        {
    57355721            /*
     
    57715757        {
    57725758            rc = RTFileRead(FileLogo, pLogoHdr + 1, LogoHdr.cbLogo, NULL);
    5773             if (VBOX_FAILURE(rc))
     5759            if (RT_FAILURE(rc))
    57745760            {
    57755761                AssertMsgFailed(("RTFileRead(,,%d,NULL) -> %Vrc\n", LogoHdr.cbLogo, rc));
     
    57825768
    57835769        rc = vbeParseBitmap(pData);
    5784         if (VBOX_FAILURE(rc))
     5770        if (RT_FAILURE(rc))
    57855771        {
    57865772            AssertMsgFailed(("vbeParseBitmap() -> %Vrc\n", rc));
     
    57905776
    57915777        rc = vbeParseBitmap(pData);
    5792         if (VBOX_FAILURE(rc))
     5778        if (RT_FAILURE(rc))
    57935779            AssertReleaseMsgFailed(("Internal bitmap failed! vbeParseBitmap() -> %Vrc\n", rc));
    57945780
     
    58275813{
    58285814#ifdef VBE_NEW_DYN_LIST
    5829     PVGASTATE   pData = PDMINS2DATA(pDevIns, PVGASTATE);
     5815    PVGASTATE   pData = PDMINS_2_DATA(pDevIns, PVGASTATE);
    58305816    LogFlow(("vgaR3Destruct:\n"));
    58315817
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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