Changeset 11194 in vbox for trunk/src/VBox/Devices/Input/DevPS2.cpp
- Timestamp:
- Aug 6, 2008 9:25:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r8170 r11194 1 1 #ifdef VBOX 2 /* $Id: $ */ 2 3 /** @file 3 * 4 * VBox input devices: 5 * PS/2 keyboard & mouse controller device 4 * DevPS2 - PS/2 keyboard & mouse controller device. 6 5 */ 7 6 … … 48 47 */ 49 48 50 51 49 /******************************************************************************* 52 50 * Header Files * … … 57 55 #include <iprt/assert.h> 58 56 59 #include " Builtins.h"57 #include "../Builtins.h" 60 58 61 59 #define PCKBD_SAVED_STATE_VERSION 2 … … 226 224 227 225 #ifdef VBOX 226 /** Pointer to the device instance - RC. */ 227 PPDMDEVINSGC pDevInsRC; 228 /** Pointer to the device instance - R3 . */ 229 PPDMDEVINSR3 pDevInsR3; 228 230 /** Pointer to the device instance. */ 229 PPDMDEVINSGC pDevInsGC; 230 /** Pointer to the device instance. */ 231 R3R0PTRTYPE(PPDMDEVINS) pDevInsHC; 231 PPDMDEVINSR0 pDevInsR0; 232 232 /** 233 233 * Keyboard port - LUN#0. … … 315 315 pic_set_irq(12, irq12_level); 316 316 #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); 319 319 #endif /* VBOX */ 320 320 } … … 454 454 val = 0x01 | (ioport_get_a20() << 1); 455 455 # else /* VBOX */ 456 val = 0x01 | (PDMDevHlpA20IsEnabled( CTXSUFF(s->pDevIns)) << 1);456 val = 0x01 | (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) << 1); 457 457 # endif /* VBOX */ 458 458 #else … … 471 471 #else /* VBOX */ 472 472 # ifndef IN_RING3 473 if (!PDMDevHlpA20IsEnabled( CTXSUFF(s->pDevIns)))473 if (!PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns))) 474 474 rc = VINF_IOM_HC_IOPORT_WRITE; 475 475 # else /* IN_RING3 */ 476 PDMDevHlpA20Set( CTXSUFF(s->pDevIns), true);476 PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), true); 477 477 # endif /* IN_RING3 */ 478 478 #endif /* VBOX */ … … 483 483 #else /* VBOX */ 484 484 # ifndef IN_RING3 485 if (PDMDevHlpA20IsEnabled( CTXSUFF(s->pDevIns)))485 if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns))) 486 486 rc = VINF_IOM_HC_IOPORT_WRITE; 487 487 # else /* IN_RING3 */ 488 PDMDevHlpA20Set( CTXSUFF(s->pDevIns), false);488 PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), false); 489 489 # endif /* !IN_RING3 */ 490 490 #endif /* VBOX */ … … 503 503 rc = VINF_IOM_HC_IOPORT_WRITE; 504 504 # else /* IN_RING3 */ 505 rc = PDMDevHlpVMReset( CTXSUFF(s->pDevIns));505 rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns)); 506 506 # endif /* !IN_RING3 */ 507 507 #endif /* VBOX */ … … 599 599 #else /* VBOX */ 600 600 if (aux) 601 PDMDevHlpISASetIrq( CTXSUFF(s->pDevIns), 12, 0);601 PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, 0); 602 602 else 603 PDMDevHlpISASetIrq( CTXSUFF(s->pDevIns), 1, 0);603 PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 0); 604 604 #endif /* VBOX */ 605 605 } … … 1012 1012 # else /* VBOX */ 1013 1013 # ifndef IN_RING3 1014 if (PDMDevHlpA20IsEnabled( CTXSUFF(s->pDevIns)) != !!(val & 2))1014 if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) != !!(val & 2)) 1015 1015 rc = VINF_IOM_HC_IOPORT_WRITE; 1016 1016 # else /* IN_RING3 */ 1017 PDMDevHlpA20Set( CTXSUFF(s->pDevIns), !!(val & 2));1017 PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), !!(val & 2)); 1018 1018 # endif /* !IN_RING3 */ 1019 1019 # endif /* VBOX */ … … 1026 1026 rc = VINF_IOM_HC_IOPORT_WRITE; 1027 1027 # else 1028 rc = PDMDevHlpVMReset( CTXSUFF(s->pDevIns));1028 rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns)); 1029 1029 # endif 1030 1030 #endif /* VBOX */ … … 1631 1631 { 1632 1632 KBDState *pData = PDMINS2DATA(pDevIns, KBDState *); 1633 pData->pDevIns GC = PDMDEVINS_2_GCPTR(pDevIns);1633 pData->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 1634 1634 } 1635 1635 … … 1661 1661 if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0R0Enabled\0")) 1662 1662 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)); 1680 1670 1681 1671 … … 1683 1673 * Initialize the interfaces. 1684 1674 */ 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); 1687 1678 pData->Keyboard.Base.pfnQueryInterface = kbdKeyboardQueryInterface; 1688 1679 pData->Keyboard.Port.pfnPutEvent = kbdKeyboardPutEvent;
Note:
See TracChangeset
for help on using the changeset viewer.