Changeset 83299 in vbox
- Timestamp:
- Mar 16, 2020 3:20:30 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Input
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r82968 r83299 318 318 case KBD_CCMD_MOUSE_DISABLE: 319 319 s->mode |= KBD_MODE_DISABLE_MOUSE; 320 PS2MLineDisable(&s->Aux); 320 321 break; 321 322 case KBD_CCMD_MOUSE_ENABLE: 323 PS2MLineEnable(&s->Aux); 322 324 s->mode &= ~KBD_MODE_DISABLE_MOUSE; 323 325 /* Check for queued input. */ 326 ///@todo: Can there actually be any? 324 327 kbd_update_irq(pDevIns, s); 325 328 break; … … 488 491 case KBD_CCMD_WRITE_MOUSE: 489 492 /* Automatically enables aux interface. */ 490 s->mode &= ~KBD_MODE_DISABLE_MOUSE; 493 if (s->mode & KBD_MODE_DISABLE_MOUSE) 494 { 495 PS2MLineEnable(&s->Aux); 496 s->mode &= ~KBD_MODE_DISABLE_MOUSE; 497 } 491 498 rc = PS2MByteToAux(pDevIns, &s->Aux, val); 492 499 if (rc == VINF_SUCCESS) … … 923 930 PKBDSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PKBDSTATER3); 924 931 RT_NOREF(pSSM); 932 if (pThis->mode & KBD_MODE_DISABLE_MOUSE) 933 PS2MLineDisable(&pThis->Aux); 934 if (pThis->mode & KBD_MODE_DISABLE_KBD) 935 PS2KLineDisable(&pThis->Kbd); 925 936 return PS2KR3LoadDone(pDevIns, &pThis->Kbd, &pThisCC->Kbd); 937 } 938 939 940 /** 941 * Debug device info handler. Prints basic auxiliary device state. 942 * 943 * @param pDevIns Device instance which registered the info. 944 * @param pHlp Callback functions for doing output. 945 * @param pszArgs Argument string. Optional and specific to the handler. 946 */ 947 static DECLCALLBACK(void) kbdR3InfoState(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) 948 { 949 PKBDSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PKBDSTATE); 950 NOREF(pszArgs); 951 952 pHlp->pfnPrintf(pHlp, "Keyboard controller: Active command %02X, DBB out %02X, translation %s\n", 953 pThis->write_cmd, pThis->dbbout, pThis->translate ? "on" : "off"); 954 955 pHlp->pfnPrintf(pHlp, "Mode: %02X ( ", pThis->mode); 956 if (pThis->mode & KBD_MODE_DISABLE_KBD) 957 pHlp->pfnPrintf(pHlp, "DISABLE_KBD "); 958 if (pThis->mode & KBD_MODE_KBD_INT) 959 pHlp->pfnPrintf(pHlp, "KBD_INT "); 960 if (pThis->mode & KBD_MODE_MOUSE_INT) 961 pHlp->pfnPrintf(pHlp, "AUX_INT "); 962 if (pThis->mode & KBD_MODE_SYS) 963 pHlp->pfnPrintf(pHlp, "SYS "); 964 if (pThis->mode & KBD_MODE_NO_KEYLOCK) 965 pHlp->pfnPrintf(pHlp, "NO_KEYLOCK "); 966 if (pThis->mode & KBD_MODE_DISABLE_KBD) 967 pHlp->pfnPrintf(pHlp, "DISABLE_KBD "); 968 if (pThis->mode & KBD_MODE_DISABLE_MOUSE) 969 pHlp->pfnPrintf(pHlp, "DISABLE_AUX "); 970 if (pThis->mode & KBD_MODE_KCC) 971 pHlp->pfnPrintf(pHlp, "KCC "); 972 if (pThis->mode & KBD_MODE_RFU) 973 pHlp->pfnPrintf(pHlp, "RFU "); 974 pHlp->pfnPrintf(pHlp, " )\n"); 975 976 pHlp->pfnPrintf(pHlp, "Status: %02X ( ", pThis->status); 977 if (pThis->status & KBD_STAT_OBF) 978 pHlp->pfnPrintf(pHlp, "OBF "); 979 if (pThis->status & KBD_STAT_IBF) 980 pHlp->pfnPrintf(pHlp, "IBF "); 981 if (pThis->status & KBD_STAT_SELFTEST) 982 pHlp->pfnPrintf(pHlp, "SELFTEST "); 983 if (pThis->status & KBD_STAT_CMD) 984 pHlp->pfnPrintf(pHlp, "CMD "); 985 if (pThis->status & KBD_STAT_UNLOCKED) 986 pHlp->pfnPrintf(pHlp, "UNLOCKED "); 987 if (pThis->status & KBD_STAT_MOUSE_OBF) 988 pHlp->pfnPrintf(pHlp, "AUX_OBF "); 989 if (pThis->status & KBD_STAT_GTO) 990 pHlp->pfnPrintf(pHlp, "GTO "); 991 if (pThis->status & KBD_STAT_PERR) 992 pHlp->pfnPrintf(pHlp, "PERR "); 993 pHlp->pfnPrintf(pHlp, " )\n"); 926 994 } 927 995 … … 1069 1137 NULL, kbdR3LoadExec, kbdR3LoadDone); 1070 1138 AssertRCReturn(rc, rc); 1139 1140 /* 1141 * Register debugger info callbacks. 1142 */ 1143 PDMDevHlpDBGFInfoRegister(pDevIns, "ps2c", "Display keyboard/mouse controller state.", kbdR3InfoState); 1071 1144 1072 1145 /* -
trunk/src/VBox/Devices/Input/DevPS2.h
r82968 r83299 149 149 /** Set if the input rate should be throttled. */ 150 150 bool fThrottleEnabled; 151 uint8_t abAlignment2[2]; 151 /** Set if the serial line is disabled on the KBC. */ 152 bool fLineDisabled; 153 uint8_t abAlignment2[1]; 152 154 153 155 /** Command delay timer. */ … … 197 199 int PS2KByteFromKbd(PPDMDEVINS pDevIns, PPS2K pThis, uint8_t *pVal); 198 200 201 void PS2KLineDisable(PPS2K pThis); 202 void PS2KLineEnable(PPS2K pThis); 203 199 204 int PS2KR3Construct(PPDMDEVINS pDevIns, PPS2K pThis, PPS2KR3 pThisCC, PCFGMNODE pCfg); 200 205 int PS2KR3Attach(PPDMDEVINS pDevIns, PPS2KR3 pThisCC, unsigned iLUN, uint32_t fFlags); … … 268 273 /** Currently processed command (if any). */ 269 274 uint8_t u8CurrCmd; 275 /** Set if the serial line is disabled on the KBC. */ 276 bool fLineDisabled; 270 277 /** Set if the throttle delay is active. */ 271 278 bool fThrottleActive; … … 341 348 int PS2MByteFromAux(PPS2M pThis, uint8_t *pVal); 342 349 350 void PS2MLineDisable(PPS2M pThis); 351 void PS2MLineEnable(PPS2M pThis); 352 343 353 int PS2MR3Construct(PPDMDEVINS pDevIns, PPS2M pThis, PPS2MR3 pThisCC); 344 354 int PS2MR3Attach(PPDMDEVINS pDevIns, PPS2MR3 pThisCC, unsigned iLUN, uint32_t fFlags); -
trunk/src/VBox/Devices/Input/DevPS2K.cpp
r82968 r83299 483 483 484 484 /** 485 * The keyboard controller disabled the keyboard serial line. 486 * 487 * @param pDevIns The device instance. 488 * @param pThis The PS/2 auxiliary device shared instance data. 489 */ 490 void PS2KLineDisable(PPS2K pThis) 491 { 492 pThis->fLineDisabled = true; 493 } 494 495 /** 496 * The keyboard controller enabled the keyboard serial line. 497 * 498 * @param pDevIns The device instance. 499 * @param pThis The PS/2 auxiliary device shared instance data. 500 */ 501 void PS2KLineEnable(PPS2K pThis) 502 { 503 pThis->fLineDisabled = false; 504 505 /* If there was anything in the input queue, 506 * consider it lost and throw it away. 507 */ 508 PS2Q_CLEAR(&pThis->keyQ); 509 } 510 511 /** 485 512 * Receive and process a byte sent by the keyboard controller. 486 513 * … … 1031 1058 NOREF(pszArgs); 1032 1059 1033 pHlp->pfnPrintf(pHlp, "PS/2 Keyboard: scan set %d, scanning %s\n", 1034 pThis->u8ScanSet, pThis->fScanning ? "enabled" : "disabled"); 1060 pHlp->pfnPrintf(pHlp, "PS/2 Keyboard: scan set %d, scanning %s, serial line %s\n", 1061 pThis->u8ScanSet, pThis->fScanning ? "enabled" : "disabled", 1062 pThis->fLineDisabled ? "disabled" : "enabled"); 1035 1063 pHlp->pfnPrintf(pHlp, "Active command %02X\n", pThis->u8CurrCmd); 1036 1064 pHlp->pfnPrintf(pHlp, "LED state %02X, Num Lock %s\n", pThis->u8LEDs, -
trunk/src/VBox/Devices/Input/DevPS2M.cpp
r82968 r83299 257 257 static void ps2mRateProtocolKnock(PPS2M pThis, uint8_t rate) 258 258 { 259 PS2M_PROTO enmOldProtocol = pThis->enmProtocol; 260 259 261 switch (pThis->enmKnockState) 260 262 { … … 299 301 pThis->enmKnockState = PS2M_KNOCK_INITIAL; 300 302 } 303 304 /* If the protocol changed, throw away any queued input because it now 305 * has the wrong format, which could severely confuse the guest. 306 */ 307 if (enmOldProtocol != pThis->enmProtocol) 308 PS2Q_CLEAR(&pThis->evtQ); 301 309 } 302 310 … … 411 419 return fValid; 412 420 } 421 422 423 /** 424 * The keyboard controller disabled the auxiliary serial line. 425 * 426 * @param pDevIns The device instance. 427 * @param pThis The PS/2 auxiliary device shared instance data. 428 */ 429 void PS2MLineDisable(PPS2M pThis) 430 { 431 pThis->fLineDisabled = true; 432 } 433 434 /** 435 * The keyboard controller enabled the auxiliary serial line. 436 * 437 * @param pDevIns The device instance. 438 * @param pThis The PS/2 auxiliary device shared instance data. 439 */ 440 void PS2MLineEnable(PPS2M pThis) 441 { 442 pThis->fLineDisabled = false; 443 444 /* If there was anything in the input queue, 445 * consider it lost and throw it away. 446 */ 447 PS2Q_CLEAR(&pThis->evtQ); 448 } 449 413 450 414 451 /** … … 743 780 744 781 Assert(pThis->enmMode < RT_ELEMENTS(s_apcszModes)); 745 pHlp->pfnPrintf(pHlp, "PS/2 mouse state: %s, %s mode, reporting %s \n",782 pHlp->pfnPrintf(pHlp, "PS/2 mouse state: %s, %s mode, reporting %s, serial line %s\n", 746 783 s_apcszModes[pThis->enmMode], 747 784 pThis->u8State & AUX_STATE_REMOTE ? "remote" : "stream", 748 pThis->u8State & AUX_STATE_ENABLED ? "enabled" : "disabled"); 785 pThis->u8State & AUX_STATE_ENABLED ? "enabled" : "disabled", 786 pThis->fLineDisabled ? "disabled" : "enabled"); 749 787 Assert(pThis->enmProtocol < RT_ELEMENTS(s_apcszProtocols)); 750 788 pHlp->pfnPrintf(pHlp, "Protocol: %s, scaling %u:1\n",
Note:
See TracChangeset
for help on using the changeset viewer.