VirtualBox

Changeset 11262 in vbox for trunk/src


Ignore:
Timestamp:
Aug 8, 2008 3:50:07 PM (16 years ago)
Author:
vboxsync
Message:

DevPIC: cosmetics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPIC.cpp

    r11261 r11262  
    153153static inline void DumpPICState(PicState *s, const char *szFn)
    154154{
    155     PDEVPIC pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
     155    PDEVPIC pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
    156156
    157157    Log2(("%s: pic%d: elcr=%x last_irr=%x irr=%x imr=%x isr=%x irq_base=%x\n",
     
    212212static int pic_get_irq(PicState *s)
    213213{
    214     PicState *pics = &(PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC))->aPics[0];
     214    PicState *pics = &(PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC))->aPics[0];
    215215    int mask, cur_priority, priority;
    216216    Log(("pic_get_irq%d: mask=%x\n", (s == pics) ? 0 : 1, s->irr & ~s->imr));
     
    352352PDMBOTHCBDECL(void) picSetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
    353353{
    354     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     354    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    355355    Assert(pData->CTX_SUFF(pDevIns) == pDevIns);
    356356    Assert(pData->aPics[0].CTX_SUFF(pDevIns) == pDevIns);
     
    398398PDMBOTHCBDECL(int) picGetInterrupt(PPDMDEVINS pDevIns)
    399399{
    400     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     400    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    401401    int         irq;
    402402    int         irq2;
     
    467467{
    468468    PicState *s = (PicState*)opaque;
    469     PDEVPIC     pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
     469    PDEVPIC     pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
    470470    int         rc = VINF_SUCCESS;
    471471    int priority, cmd, irq;
     
    587587static uint32_t pic_poll_read (PicState *s, uint32_t addr1)
    588588{
    589     PDEVPIC     pData = PDMINS2DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
     589    PDEVPIC     pData = PDMINS_2_DATA(s->CTX_SUFF(pDevIns), PDEVPIC);
    590590    PicState   *pics = &pData->aPics[0];
    591591    int ret;
     
    706706PDMBOTHCBDECL(int) picIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    707707{
    708     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     708    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    709709    uint32_t    iPic  = (uint32_t)(uintptr_t)pvUser;
    710710
     
    734734PDMBOTHCBDECL(int) picIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    735735{
    736     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     736    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    737737    uint32_t    iPic  = (uint32_t)(uintptr_t)pvUser;
    738738
     
    767767    {
    768768        PicState *s = (PicState*)pvUser;
    769         PIC_LOCK(PDMINS2DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_READ);
     769        PIC_LOCK(PDMINS_2_DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_READ);
    770770        *pu32 = s->elcr;
    771         PIC_UNLOCK(PDMINS2DATA(pDevIns, PDEVPIC));
     771        PIC_UNLOCK(PDMINS_2_DATA(pDevIns, PDEVPIC));
    772772        return VINF_SUCCESS;
    773773    }
     
    791791    {
    792792        PicState *s = (PicState*)pvUser;
    793         PIC_LOCK(PDMINS2DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_WRITE);
     793        PIC_LOCK(PDMINS_2_DATA(pDevIns, PDEVPIC), VINF_IOM_HC_IOPORT_WRITE);
    794794        s->elcr = u32 & s->elcr_mask;
    795         PIC_UNLOCK(PDMINS2DATA(pDevIns, PDEVPIC));
     795        PIC_UNLOCK(PDMINS_2_DATA(pDevIns, PDEVPIC));
    796796    }
    797797    return VINF_SUCCESS;
     
    811811static DECLCALLBACK(void) picInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    812812{
    813     PDEVPIC pData = PDMINS2DATA(pDevIns, PDEVPIC);
     813    PDEVPIC pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    814814
    815815    /*
     
    848848static DECLCALLBACK(int) picSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
    849849{
    850     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     850    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    851851    pic_save(pSSMHandle, &pData->aPics[0]);
    852852    pic_save(pSSMHandle, &pData->aPics[1]);
     
    865865static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
    866866{
    867     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     867    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    868868    int rc = pic_load(pSSMHandle, &pData->aPics[0], u32Version);
    869     if (VBOX_SUCCESS(rc))
     869    if (RT_SUCCESS(rc))
    870870        rc = pic_load(pSSMHandle, &pData->aPics[1], u32Version);
    871871    return rc;
     
    883883static DECLCALLBACK(void)  picReset(PPDMDEVINS pDevIns)
    884884{
    885     PDEVPIC     pData = PDMINS2DATA(pDevIns, PDEVPIC);
     885    PDEVPIC     pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    886886    unsigned    i;
    887887    LogFlow(("picReset:\n"));
    888888    pData->pPicHlpR3->pfnLock(pDevIns, VERR_INTERNAL_ERROR);
    889889
    890     for (i = 0; i < ELEMENTS(pData->aPics); i++)
     890    for (i = 0; i < RT_ELEMENTS(pData->aPics); i++)
    891891        pic_reset(&pData->aPics[i]);
    892892
     
    900900static DECLCALLBACK(void) picRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    901901{
    902     PDEVPIC         pData = PDMINS2DATA(pDevIns, PDEVPIC);
     902    PDEVPIC         pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    903903    unsigned        i;
    904904
     
    915915static DECLCALLBACK(int)  picConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle)
    916916{
    917     PDEVPIC         pData = PDMINS2DATA(pDevIns, PDEVPIC);
     917    PDEVPIC         pData = PDMINS_2_DATA(pDevIns, PDEVPIC);
    918918    PDMPICREG       PicReg;
    919919    int             rc;
     
    931931    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    932932        fGCEnabled = true;
    933     else if (VBOX_FAILURE(rc))
     933    else if (RT_FAILURE(rc))
    934934        return PDMDEV_SET_ERROR(pDevIns, rc,
    935935                                N_("Configuration error: failed to read GCEnabled as boolean"));
     
    938938    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    939939        fR0Enabled = true;
    940     else if (VBOX_FAILURE(rc))
     940    else if (RT_FAILURE(rc))
    941941        return PDMDEV_SET_ERROR(pDevIns, rc,
    942942                                N_("Configuration error: failed to read R0Enabled as boolean"));
     
    947947     * Init the data.
    948948     */
    949     Assert(ELEMENTS(pData->aPics) == 2);
     949    Assert(RT_ELEMENTS(pData->aPics) == 2);
    950950    pData->pDevInsR3 = pDevIns;
    951951    pData->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
     
    10021002     */
    10031003    rc = PDMDevHlpIOPortRegister(pDevIns,  0x20, 2, (void *)0, picIOPortWrite, picIOPortRead, NULL, NULL, "i8259 PIC #0");
    1004     if (VBOX_FAILURE(rc))
     1004    if (RT_FAILURE(rc))
    10051005        return rc;
    10061006    rc = PDMDevHlpIOPortRegister(pDevIns,  0xa0, 2, (void *)1, picIOPortWrite, picIOPortRead, NULL, NULL, "i8259 PIC #1");
    1007     if (VBOX_FAILURE(rc))
     1007    if (RT_FAILURE(rc))
    10081008        return rc;
    10091009    if (fGCEnabled)
    10101010    {
    10111011        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0x20, 2, 0, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #0");
    1012         if (VBOX_FAILURE(rc))
     1012        if (RT_FAILURE(rc))
    10131013            return rc;
    10141014        rc = PDMDevHlpIOPortRegisterGC(pDevIns,  0xa0, 2, 1, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #1");
    1015         if (VBOX_FAILURE(rc))
     1015        if (RT_FAILURE(rc))
    10161016            return rc;
    10171017    }
     
    10191019    {
    10201020        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0x20, 2, 0, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #0");
    1021         if (VBOX_FAILURE(rc))
     1021        if (RT_FAILURE(rc))
    10221022            return rc;
    10231023        rc = PDMDevHlpIOPortRegisterR0(pDevIns,  0xa0, 2, 1, "picIOPortWrite", "picIOPortRead", NULL, NULL, "i8259 PIC #1");
    1024         if (VBOX_FAILURE(rc))
     1024        if (RT_FAILURE(rc))
    10251025            return rc;
    10261026    }
     
    10281028    rc = PDMDevHlpIOPortRegister(pDevIns, 0x4d0, 1, &pData->aPics[0],
    10291029                                 picIOPortElcrWrite, picIOPortElcrRead, NULL, NULL, "i8259 PIC #0 - elcr");
    1030     if (VBOX_FAILURE(rc))
     1030    if (RT_FAILURE(rc))
    10311031        return rc;
    10321032    rc = PDMDevHlpIOPortRegister(pDevIns, 0x4d1, 1, &pData->aPics[1],
    10331033                                 picIOPortElcrWrite, picIOPortElcrRead, NULL, NULL, "i8259 PIC #1 - elcr");
    1034     if (VBOX_FAILURE(rc))
     1034    if (RT_FAILURE(rc))
    10351035        return rc;
    10361036    if (fGCEnabled)
    10371037    {
    1038         RTGCPTR pDataGC = PDMINS2DATA_GCPTR(pDevIns);
    1039         rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d0, 1, pDataGC + RT_OFFSETOF(DEVPIC, aPics[0]),
     1038        RTRCPTR pDataRC = PDMINS_2_DATA_RCPTR(pDevIns);
     1039        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d0, 1, pDataRC + RT_OFFSETOF(DEVPIC, aPics[0]),
    10401040                                       "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #0 - elcr");
    1041         if (VBOX_FAILURE(rc))
     1041        if (RT_FAILURE(rc))
    10421042            return rc;
    1043         rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d1, 1, pDataGC + RT_OFFSETOF(DEVPIC, aPics[1]),
     1043        rc = PDMDevHlpIOPortRegisterGC(pDevIns, 0x4d1, 1, pDataRC + RT_OFFSETOF(DEVPIC, aPics[1]),
    10441044                                       "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #1 - elcr");
    1045         if (VBOX_FAILURE(rc))
     1045        if (RT_FAILURE(rc))
    10461046            return rc;
    10471047    }
    10481048    if (fR0Enabled)
    10491049    {
    1050         RTR0PTR pDataR0 = PDMINS2DATA_R0PTR(pDevIns);
     1050        RTR0PTR pDataR0 = PDMINS_2_DATA_R0PTR(pDevIns);
    10511051        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x4d0, 1, pDataR0 + RT_OFFSETOF(DEVPIC, aPics[0]),
    10521052                                       "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #0 - elcr");
    1053         if (VBOX_FAILURE(rc))
     1053        if (RT_FAILURE(rc))
    10541054            return rc;
    10551055        rc = PDMDevHlpIOPortRegisterR0(pDevIns, 0x4d1, 1, pDataR0 + RT_OFFSETOF(DEVPIC, aPics[1]),
    10561056                                       "picIOPortElcrWrite", "picIOPortElcrRead", NULL, NULL, "i8259 PIC #1 - elcr");
    1057         if (VBOX_FAILURE(rc))
     1057        if (RT_FAILURE(rc))
    10581058            return rc;
    10591059    }
     
    10621062                              NULL, picSaveExec, NULL,
    10631063                              NULL, picLoadExec, NULL);
    1064     if (VBOX_FAILURE(rc))
     1064    if (RT_FAILURE(rc))
    10651065        return rc;
    10661066
Note: See TracChangeset for help on using the changeset viewer.

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