VirtualBox

Ignore:
Timestamp:
Aug 6, 2008 9:25:20 PM (16 years ago)
Author:
vboxsync
Message:

#1865: DevPS2.

File:
1 edited

Legend:

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

    r8170 r11194  
    11#ifdef VBOX
     2/* $Id: $ */
    23/** @file
    3  *
    4  * VBox input devices:
    5  * PS/2 keyboard & mouse controller device
     4 * DevPS2 - PS/2 keyboard & mouse controller device.
    65 */
    76
     
    4847 */
    4948
    50 
    5149/*******************************************************************************
    5250*   Header Files                                                               *
     
    5755#include <iprt/assert.h>
    5856
    59 #include "Builtins.h"
     57#include "../Builtins.h"
    6058
    6159#define PCKBD_SAVED_STATE_VERSION 2
     
    226224
    227225#ifdef VBOX
     226    /** Pointer to the device instance - RC. */
     227    PPDMDEVINSGC                pDevInsRC;
     228    /** Pointer to the device instance - R3 . */
     229    PPDMDEVINSR3                pDevInsR3;
    228230    /** Pointer to the device instance. */
    229     PPDMDEVINSGC                pDevInsGC;
    230     /** Pointer to the device instance. */
    231     R3R0PTRTYPE(PPDMDEVINS)     pDevInsHC;
     231    PPDMDEVINSR0                pDevInsR0;
    232232    /**
    233233     * Keyboard port - LUN#0.
     
    315315    pic_set_irq(12, irq12_level);
    316316#else /* VBOX */
    317     PDMDevHlpISASetIrq(CTXSUFF(s->pDevIns), 1, irq1_level);
    318     PDMDevHlpISASetIrq(CTXSUFF(s->pDevIns), 12, irq12_level);
     317    PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, irq1_level);
     318    PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, irq12_level);
    319319#endif /* VBOX */
    320320}
     
    454454        val = 0x01 | (ioport_get_a20() << 1);
    455455# else /* VBOX */
    456         val = 0x01 | (PDMDevHlpA20IsEnabled(CTXSUFF(s->pDevIns)) << 1);
     456        val = 0x01 | (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) << 1);
    457457# endif /* VBOX */
    458458#else
     
    471471#else /* VBOX */
    472472# ifndef IN_RING3
    473         if (!PDMDevHlpA20IsEnabled(CTXSUFF(s->pDevIns)))
     473        if (!PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
    474474            rc = VINF_IOM_HC_IOPORT_WRITE;
    475475# else /* IN_RING3 */
    476         PDMDevHlpA20Set(CTXSUFF(s->pDevIns), true);
     476        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), true);
    477477# endif /* IN_RING3 */
    478478#endif /* VBOX */
     
    483483#else /* VBOX */
    484484# ifndef IN_RING3
    485         if (PDMDevHlpA20IsEnabled(CTXSUFF(s->pDevIns)))
     485        if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
    486486            rc = VINF_IOM_HC_IOPORT_WRITE;
    487487# else /* IN_RING3 */
    488         PDMDevHlpA20Set(CTXSUFF(s->pDevIns), false);
     488        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), false);
    489489# endif /* !IN_RING3 */
    490490#endif /* VBOX */
     
    503503        rc = VINF_IOM_HC_IOPORT_WRITE;
    504504# else /* IN_RING3 */
    505         rc = PDMDevHlpVMReset(CTXSUFF(s->pDevIns));
     505        rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns));
    506506# endif /* !IN_RING3 */
    507507#endif /* VBOX */
     
    599599#else /* VBOX */
    600600        if (aux)
    601             PDMDevHlpISASetIrq(CTXSUFF(s->pDevIns), 12, 0);
     601            PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, 0);
    602602        else
    603             PDMDevHlpISASetIrq(CTXSUFF(s->pDevIns), 1, 0);
     603            PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 0);
    604604#endif /* VBOX */
    605605    }
     
    10121012# else /* VBOX */
    10131013#  ifndef IN_RING3
    1014         if (PDMDevHlpA20IsEnabled(CTXSUFF(s->pDevIns)) != !!(val & 2))
     1014        if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) != !!(val & 2))
    10151015            rc = VINF_IOM_HC_IOPORT_WRITE;
    10161016#  else /* IN_RING3 */
    1017         PDMDevHlpA20Set(CTXSUFF(s->pDevIns), !!(val & 2));
     1017        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), !!(val & 2));
    10181018#  endif /* !IN_RING3 */
    10191019# endif /* VBOX */
     
    10261026            rc = VINF_IOM_HC_IOPORT_WRITE;
    10271027# else
    1028             rc = PDMDevHlpVMReset(CTXSUFF(s->pDevIns));
     1028            rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns));
    10291029# endif
    10301030#endif /* VBOX */
     
    16311631{
    16321632    KBDState   *pData = PDMINS2DATA(pDevIns, KBDState *);
    1633     pData->pDevInsGC = PDMDEVINS_2_GCPTR(pDevIns);
     1633    pData->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    16341634}
    16351635
     
    16611661    if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0R0Enabled\0"))
    16621662        return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    1663     rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled);
    1664     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    1665         fGCEnabled = true;
    1666     else if (VBOX_FAILURE(rc))
    1667     {
    1668         AssertMsgFailed(("configuration error: failed to read GCEnabled as boolean. rc=%Vrc\n", rc));
    1669         return rc;
    1670     }
    1671     rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &fR0Enabled);
    1672     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    1673         fR0Enabled = true;
    1674     else if (VBOX_FAILURE(rc))
    1675     {
    1676         AssertMsgFailed(("configuration error: failed to read R0Enabled as boolean. rc=%Vrc\n", rc));
    1677         return rc;
    1678     }
    1679     Log(("pckbd: fGCEnabled=%d fR0Enabled=%d\n", fGCEnabled, fR0Enabled));
     1663    rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true);
     1664    if (VBOX_FAILURE(rc))
     1665        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to query \"GCEnabled\" from the config"));
     1666    rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true);
     1667    if (VBOX_FAILURE(rc))
     1668        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to query \"R0Enabled\" from the config"));
     1669    Log(("pckbd: fGCEnabled=%RTbool fR0Enabled=%RTbool\n", fGCEnabled, fR0Enabled));
    16801670
    16811671
     
    16831673     * Initialize the interfaces.
    16841674     */
    1685     pData->pDevInsHC = pDevIns;
    1686     pData->pDevInsGC = PDMDEVINS_2_GCPTR(pDevIns);
     1675    pData->pDevInsR3 = pDevIns;
     1676    pData->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
     1677    pData->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    16871678    pData->Keyboard.Base.pfnQueryInterface  = kbdKeyboardQueryInterface;
    16881679    pData->Keyboard.Port.pfnPutEvent        = kbdKeyboardPutEvent;
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