VirtualBox

Changeset 82203 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2019 9:53:27 PM (5 years ago)
Author:
vboxsync
Message:

DevPS2: Eliminated some pDevInsR? structure members. bugref:9218

Location:
trunk/src/VBox/Devices/Input
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r82202 r82203  
    272272        }
    273273    }
    274     PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, irq1_level);
    275     PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, irq12_level);
     274    PDMDevHlpISASetIrq(pDevIns, 1, irq1_level);
     275    PDMDevHlpISASetIrq(pDevIns, 12, irq12_level);
    276276}
    277277
     
    282282}
    283283
    284 static void kbc_dbb_out(PKBDSTATE s, uint8_t val)
     284static void kbc_dbb_out(PPDMDEVINS pDevIns, PKBDSTATE s, uint8_t val)
    285285{
    286286    s->dbbout = val;
     
    288288    s->status |= KBD_STAT_OBF;
    289289    if (s->mode & KBD_MODE_KBD_INT)
    290         PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 1);
    291 }
    292 
    293 static void kbc_dbb_out_aux(PKBDSTATE s, uint8_t val)
     290        PDMDevHlpISASetIrq(pDevIns, 1, 1);
     291}
     292
     293static void kbc_dbb_out_aux(PPDMDEVINS pDevIns, PKBDSTATE s, uint8_t val)
    294294{
    295295    s->dbbout = val;
     
    297297    s->status |= KBD_STAT_OBF | KBD_STAT_MOUSE_OBF;
    298298    if (s->mode & KBD_MODE_MOUSE_INT)
    299         PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, PDM_IRQ_LEVEL_HIGH);
     299        PDMDevHlpISASetIrq(pDevIns, 12, PDM_IRQ_LEVEL_HIGH);
    300300}
    301301
     
    307307    switch(val) {
    308308    case KBD_CCMD_READ_MODE:
    309         kbc_dbb_out(s, s->mode);
     309        kbc_dbb_out(pDevIns, s, s->mode);
    310310        break;
    311311    case KBD_CCMD_WRITE_MODE:
     
    325325        break;
    326326    case KBD_CCMD_TEST_MOUSE:
    327         kbc_dbb_out(s, 0x00);
     327        kbc_dbb_out(pDevIns, s, 0x00);
    328328        break;
    329329    case KBD_CCMD_SELF_TEST:
    330330        /* Enable the A20 line - that is the power-on state(!). */
    331331# ifndef IN_RING3
    332         if (!PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
     332        if (!PDMDevHlpA20IsEnabled(pDevIns))
    333333            return VINF_IOM_R3_IOPORT_WRITE;
    334334# else  /* IN_RING3 */
    335         PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), true);
     335        PDMDevHlpA20Set(pDevIns, true);
    336336# endif /* IN_RING3 */
    337337        s->status |= KBD_STAT_SELFTEST;
    338338        s->mode |= KBD_MODE_DISABLE_KBD;
    339         kbc_dbb_out(s, 0x55);
     339        kbc_dbb_out(pDevIns, s, 0x55);
    340340        break;
    341341    case KBD_CCMD_KBD_TEST:
    342         kbc_dbb_out(s, 0x00);
     342        kbc_dbb_out(pDevIns, s, 0x00);
    343343        break;
    344344    case KBD_CCMD_KBD_DISABLE:
     
    351351        break;
    352352    case KBD_CCMD_READ_INPORT:
    353         kbc_dbb_out(s, 0xBF);
     353        kbc_dbb_out(pDevIns, s, 0xBF);
    354354        break;
    355355    case KBD_CCMD_READ_OUTPORT:
    356356        /* XXX: check that */
    357357#ifdef TARGET_I386
    358         val = 0x01 | (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) << 1);
     358        val = 0x01 | (PDMDevHlpA20IsEnabled(pDevIns) << 1);
    359359#else
    360360        val = 0x01;
     
    364364        if (s->status & KBD_STAT_MOUSE_OBF)
    365365            val |= 0x20;
    366         kbc_dbb_out(s, val);
     366        kbc_dbb_out(pDevIns, s, val);
    367367        break;
    368368#ifdef TARGET_I386
    369369    case KBD_CCMD_ENABLE_A20:
    370370# ifndef IN_RING3
    371         if (!PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
     371        if (!PDMDevHlpA20IsEnabled(pDevIns))
    372372            return VINF_IOM_R3_IOPORT_WRITE;
    373373# else  /* IN_RING3 */
    374         PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), true);
     374        PDMDevHlpA20Set(pDevIns, true);
    375375# endif /* IN_RING3 */
    376376        break;
    377377    case KBD_CCMD_DISABLE_A20:
    378378# ifndef IN_RING3
    379         if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
     379        if (PDMDevHlpA20IsEnabled(pDevIns))
    380380            return VINF_IOM_R3_IOPORT_WRITE;
    381381# else  /* IN_RING3 */
    382         PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), false);
     382        PDMDevHlpA20Set(pDevIns, false);
    383383# endif /* IN_RING3 */
    384384        break;
     
    387387        /* Keyboard clock line is zero IFF keyboard is disabled */
    388388        val = (s->mode & KBD_MODE_DISABLE_KBD) ? 0 : 1;
    389         kbc_dbb_out(s, val);
     389        kbc_dbb_out(pDevIns, s, val);
    390390        break;
    391391    case KBD_CCMD_RESET:
     
    395395#else  /* IN_RING3 */
    396396        LogRel(("Reset initiated by keyboard controller\n"));
    397         return PDMDevHlpVMReset(s->CTX_SUFF(pDevIns), PDMVMRESET_F_KBD);
     397        return PDMDevHlpVMReset(pDevIns, PDMVMRESET_F_KBD);
    398398#endif /* IN_RING3 */
    399399    case 0xff:
     
    409409    case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
    410410    case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
    411         kbc_dbb_out(s, 0);
     411        kbc_dbb_out(pDevIns, s, 0);
    412412        Log(("kbd: reading non-standard RAM addr %#x\n", val & 0x1f));
    413413        break;
     
    428428    /* Reading the DBB deasserts IRQs... */
    429429    if (s->status & KBD_STAT_MOUSE_OBF)
    430         PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, 0);
     430        PDMDevHlpISASetIrq(pDevIns, 12, 0);
    431431    else
    432         PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 0);
     432        PDMDevHlpISASetIrq(pDevIns, 1, 0);
    433433    /* ...and clears the OBF bits. */
    434434    s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF);
     
    476476        break;
    477477    case KBD_CCMD_WRITE_OBUF:
    478         kbc_dbb_out(s, val);
     478        kbc_dbb_out(pDevIns, s, val);
    479479        break;
    480480    case KBD_CCMD_WRITE_AUX_OBUF:
    481         kbc_dbb_out_aux(s, val);
     481        kbc_dbb_out_aux(pDevIns, s, val);
    482482        break;
    483483    case KBD_CCMD_WRITE_OUTPORT:
    484484#ifdef TARGET_I386
    485485#  ifndef IN_RING3
    486         if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) != !!(val & 2))
     486        if (PDMDevHlpA20IsEnabled(pDevIns) != !!(val & 2))
    487487            rc = VINF_IOM_R3_IOPORT_WRITE;
    488488#  else /* IN_RING3 */
    489         PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), !!(val & 2));
     489        PDMDevHlpA20Set(pDevIns, !!(val & 2));
    490490#  endif /* IN_RING3 */
    491491#endif
     
    494494            rc = VINF_IOM_R3_IOPORT_WRITE;
    495495# else
    496             rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns), PDMVMRESET_F_KBD);
     496            rc = PDMDevHlpVMReset(pDevIns, PDMVMRESET_F_KBD);
    497497# endif
    498498        }
     
    10181018
    10191019    /*
    1020      * Initialize the interfaces.
     1020     * Initialize the sub-components.
    10211021     */
    1022     pThis->pDevInsR3 = pDevIns;
    1023     pThis->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
    1024     pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    1025 
    10261022    rc = PS2KR3Construct(&pThis->Kbd, pDevIns, pThis, iInstance, pCfg);
    10271023    AssertRCReturn(rc, rc);
  • trunk/src/VBox/Devices/Input/DevPS2.h

    r82201 r82203  
    334334    int32_t xlat_state;
    335335
    336     /** Pointer to the device instance - RC. */
    337     PPDMDEVINSRC                pDevInsRC;
    338     /** Pointer to the device instance - R3 . */
    339     PPDMDEVINSR3                pDevInsR3;
    340     /** Pointer to the device instance. */
    341     PPDMDEVINSR0                pDevInsR0;
    342 
    343336    /** I/O port 60h. */
    344337    IOMIOPORTHANDLE             hIoPortData;
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