VirtualBox

忽略:
時間撮記:
2013-12-12 下午03:10:49 (11 年 以前)
作者:
vboxsync
訊息:

Devices/Graphics/DevVGA: eliminate use of vl_vbox.h

檔案:
修改 1 筆資料

圖例:

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

    r49884 r49887  
    112112#include <VBox/vmm/pgm.h>
    113113#ifdef IN_RING3
     114# include <iprt/cdefs.h>
    114115# include <iprt/alloc.h>
    115116# include <iprt/ctype.h>
     
    134135#endif
    135136
    136 #include "vl_vbox.h"
    137137#include "VBoxDD.h"
    138138#include "VBoxDD2.h"
     
    11751175
    11761176/* called for accesses between 0xa0000 and 0xc0000 */
    1177 static uint32_t vga_mem_readb(PVGASTATE pThis, target_phys_addr_t addr, int *prc)
     1177static uint32_t vga_mem_readb(PVGASTATE pThis, RTGCPHYS addr, int *prc)
    11781178{
    11791179    int memory_map_mode, plane;
     
    12561256
    12571257/* called for accesses between 0xa0000 and 0xc0000 */
    1258 static int vga_mem_writeb(PVGASTATE pThis, target_phys_addr_t addr, uint32_t val)
     1258static int vga_mem_writeb(PVGASTATE pThis, RTGCPHYS addr, uint32_t val)
    12591259{
    12601260    int memory_map_mode, plane, write_mode, b, func_select, mask;
     
    22012201            addr = (addr & ~(1 << 16)) | ((y1 & 2) << 15);
    22022202        }
    2203         page0 = addr & TARGET_PAGE_MASK;
    2204         page1 = (addr + bwidth - 1) & TARGET_PAGE_MASK;
     2203        page0 = addr & ~PAGE_OFFSET_MASK;
     2204        page1 = (addr + bwidth - 1) & ~PAGE_OFFSET_MASK;
    22052205        bool update = full_update | vga_is_dirty(pThis, page0) | vga_is_dirty(pThis, page1);
    2206         if (page1 - page0 > TARGET_PAGE_SIZE) {
     2206        if (page1 - page0 > PAGE_SIZE) {
    22072207            /* if wide line, can use another page */
    2208             update |= vga_is_dirty(pThis, page0 + TARGET_PAGE_SIZE);
     2208            update |= vga_is_dirty(pThis, page0 + PAGE_SIZE);
    22092209        }
    22102210        /* explicit invalidation for the hardware cursor */
     
    22522252    /* reset modified pages */
    22532253    if (page_max != -1 && reset_dirty) {
    2254         vga_reset_dirty(pThis, page_min, page_max + TARGET_PAGE_SIZE);
     2254        vga_reset_dirty(pThis, page_min, page_max + PAGE_SIZE);
    22552255    }
    22562256    memset(pThis->invalidated_y_table, 0, ((height + 31) >> 5) * 4);
     
    23912391}
    23922392
    2393 static void vga_save(QEMUFile *f, PVGASTATE pThis)
     2393static void vga_save(PSSMHANDLE pSSM, PVGASTATE pThis)
    23942394{
    23952395    int i;
    23962396
    2397     qemu_put_be32s(f, &pThis->latch);
    2398     qemu_put_8s(f, &pThis->sr_index);
    2399     qemu_put_buffer(f, pThis->sr, 8);
    2400     qemu_put_8s(f, &pThis->gr_index);
    2401     qemu_put_buffer(f, pThis->gr, 16);
    2402     qemu_put_8s(f, &pThis->ar_index);
    2403     qemu_put_buffer(f, pThis->ar, 21);
    2404     qemu_put_be32s(f, &pThis->ar_flip_flop);
    2405     qemu_put_8s(f, &pThis->cr_index);
    2406     qemu_put_buffer(f, pThis->cr, 256);
    2407     qemu_put_8s(f, &pThis->msr);
    2408     qemu_put_8s(f, &pThis->fcr);
    2409     qemu_put_8s(f, &pThis->st00);
    2410     qemu_put_8s(f, &pThis->st01);
    2411 
    2412     qemu_put_8s(f, &pThis->dac_state);
    2413     qemu_put_8s(f, &pThis->dac_sub_index);
    2414     qemu_put_8s(f, &pThis->dac_read_index);
    2415     qemu_put_8s(f, &pThis->dac_write_index);
    2416     qemu_put_buffer(f, pThis->dac_cache, 3);
    2417     qemu_put_buffer(f, pThis->palette, 768);
    2418 
    2419     qemu_put_be32s(f, &pThis->bank_offset);
     2397    SSMR3PutU32(pSSM, pThis->latch);
     2398    SSMR3PutU8(pSSM, pThis->sr_index);
     2399    SSMR3PutMem(pSSM, pThis->sr, 8);
     2400    SSMR3PutU8(pSSM, pThis->gr_index);
     2401    SSMR3PutMem(pSSM, pThis->gr, 16);
     2402    SSMR3PutU8(pSSM, pThis->ar_index);
     2403    SSMR3PutMem(pSSM, pThis->ar, 21);
     2404    SSMR3PutU32(pSSM, pThis->ar_flip_flop);
     2405    SSMR3PutU8(pSSM, pThis->cr_index);
     2406    SSMR3PutMem(pSSM, pThis->cr, 256);
     2407    SSMR3PutU8(pSSM, pThis->msr);
     2408    SSMR3PutU8(pSSM, pThis->fcr);
     2409    SSMR3PutU8(pSSM, pThis->st00);
     2410    SSMR3PutU8(pSSM, pThis->st01);
     2411
     2412    SSMR3PutU8(pSSM, pThis->dac_state);
     2413    SSMR3PutU8(pSSM, pThis->dac_sub_index);
     2414    SSMR3PutU8(pSSM, pThis->dac_read_index);
     2415    SSMR3PutU8(pSSM, pThis->dac_write_index);
     2416    SSMR3PutMem(pSSM, pThis->dac_cache, 3);
     2417    SSMR3PutMem(pSSM, pThis->palette, 768);
     2418
     2419    SSMR3PutU32(pSSM, pThis->bank_offset);
    24202420#ifdef CONFIG_BOCHS_VBE
    2421     qemu_put_byte(f, 1);
    2422     qemu_put_be16s(f, &pThis->vbe_index);
     2421    SSMR3PutU8(pSSM, 1);
     2422    SSMR3PutU16(pSSM, pThis->vbe_index);
    24232423    for(i = 0; i < VBE_DISPI_INDEX_NB_SAVED; i++)
    2424         qemu_put_be16s(f, &pThis->vbe_regs[i]);
    2425     qemu_put_be32s(f, &pThis->vbe_start_addr);
    2426     qemu_put_be32s(f, &pThis->vbe_line_offset);
     2424        SSMR3PutU16(pSSM, pThis->vbe_regs[i]);
     2425    SSMR3PutU32(pSSM, pThis->vbe_start_addr);
     2426    SSMR3PutU32(pSSM, pThis->vbe_line_offset);
    24272427#else
    2428     qemu_put_byte(f, 0);
     2428    SSMR3PutU8(pSSM, 0);
    24292429#endif
    24302430}
    24312431
    2432 static int vga_load(QEMUFile *f, PVGASTATE pThis, int version_id)
     2432static int vga_load(PSSMHANDLE pSSM, PVGASTATE pThis, int version_id)
    24332433{
    24342434    int is_vbe, i;
    24352435    uint32_t u32Dummy;
    2436 
    2437     qemu_get_be32s(f, &pThis->latch);
    2438     qemu_get_8s(f, &pThis->sr_index);
    2439     qemu_get_buffer(f, pThis->sr, 8);
    2440     qemu_get_8s(f, &pThis->gr_index);
    2441     qemu_get_buffer(f, pThis->gr, 16);
    2442     qemu_get_8s(f, &pThis->ar_index);
    2443     qemu_get_buffer(f, pThis->ar, 21);
    2444     qemu_get_be32s(f, (uint32_t *)&pThis->ar_flip_flop);
    2445     qemu_get_8s(f, &pThis->cr_index);
    2446     qemu_get_buffer(f, pThis->cr, 256);
    2447     qemu_get_8s(f, &pThis->msr);
    2448     qemu_get_8s(f, &pThis->fcr);
    2449     qemu_get_8s(f, &pThis->st00);
    2450     qemu_get_8s(f, &pThis->st01);
    2451 
    2452     qemu_get_8s(f, &pThis->dac_state);
    2453     qemu_get_8s(f, &pThis->dac_sub_index);
    2454     qemu_get_8s(f, &pThis->dac_read_index);
    2455     qemu_get_8s(f, &pThis->dac_write_index);
    2456     qemu_get_buffer(f, pThis->dac_cache, 3);
    2457     qemu_get_buffer(f, pThis->palette, 768);
    2458 
    2459     qemu_get_be32s(f, (uint32_t *)&pThis->bank_offset);
    2460     is_vbe = qemu_get_byte(f);
     2436    uint8_t u8;
     2437
     2438    SSMR3GetU32(pSSM, &pThis->latch);
     2439    SSMR3GetU8(pSSM, &pThis->sr_index);
     2440    SSMR3GetMem(pSSM, pThis->sr, 8);
     2441    SSMR3GetU8(pSSM, &pThis->gr_index);
     2442    SSMR3GetMem(pSSM, pThis->gr, 16);
     2443    SSMR3GetU8(pSSM, &pThis->ar_index);
     2444    SSMR3GetMem(pSSM, pThis->ar, 21);
     2445    SSMR3GetU32(pSSM, (uint32_t *)&pThis->ar_flip_flop);
     2446    SSMR3GetU8(pSSM, &pThis->cr_index);
     2447    SSMR3GetMem(pSSM, pThis->cr, 256);
     2448    SSMR3GetU8(pSSM, &pThis->msr);
     2449    SSMR3GetU8(pSSM, &pThis->fcr);
     2450    SSMR3GetU8(pSSM, &pThis->st00);
     2451    SSMR3GetU8(pSSM, &pThis->st01);
     2452
     2453    SSMR3GetU8(pSSM, &pThis->dac_state);
     2454    SSMR3GetU8(pSSM, &pThis->dac_sub_index);
     2455    SSMR3GetU8(pSSM, &pThis->dac_read_index);
     2456    SSMR3GetU8(pSSM, &pThis->dac_write_index);
     2457    SSMR3GetMem(pSSM, pThis->dac_cache, 3);
     2458    SSMR3GetMem(pSSM, pThis->palette, 768);
     2459
     2460    SSMR3GetU32(pSSM, (uint32_t *)&pThis->bank_offset);
     2461    SSMR3GetU8(pSSM, &u8);
     2462    is_vbe = !!u8;
    24612463#ifdef CONFIG_BOCHS_VBE
    24622464    if (!is_vbe)
     
    24652467        return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
    24662468    }
    2467     qemu_get_be16s(f, &pThis->vbe_index);
     2469    SSMR3GetU16(pSSM, &pThis->vbe_index);
    24682470    for(i = 0; i < VBE_DISPI_INDEX_NB_SAVED; i++)
    2469         qemu_get_be16s(f, &pThis->vbe_regs[i]);
     2471        SSMR3GetU16(pSSM, &pThis->vbe_regs[i]);
    24702472    if (version_id <= VGA_SAVEDSTATE_VERSION_INV_VHEIGHT)
    24712473        recalculate_data(pThis, false); /* <- re-calculate the pThis->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] since it might be invalid */
    2472     qemu_get_be32s(f, &pThis->vbe_start_addr);
    2473     qemu_get_be32s(f, &pThis->vbe_line_offset);
     2474    SSMR3GetU32(pSSM, &pThis->vbe_start_addr);
     2475    SSMR3GetU32(pSSM, &pThis->vbe_line_offset);
    24742476    if (version_id < 2)
    2475         qemu_get_be32s(f, &u32Dummy);
     2477        SSMR3GetU32(pSSM, &u32Dummy);
    24762478    pThis->vbe_bank_max = (pThis->vram_size >> 16) - 1;
    24772479#else
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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