- Timestamp:
- Nov 25, 2019 9:53:27 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Input
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r82202 r82203 272 272 } 273 273 } 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); 276 276 } 277 277 … … 282 282 } 283 283 284 static void kbc_dbb_out(P KBDSTATE s, uint8_t val)284 static void kbc_dbb_out(PPDMDEVINS pDevIns, PKBDSTATE s, uint8_t val) 285 285 { 286 286 s->dbbout = val; … … 288 288 s->status |= KBD_STAT_OBF; 289 289 if (s->mode & KBD_MODE_KBD_INT) 290 PDMDevHlpISASetIrq( s->CTX_SUFF(pDevIns), 1, 1);291 } 292 293 static void kbc_dbb_out_aux(P KBDSTATE s, uint8_t val)290 PDMDevHlpISASetIrq(pDevIns, 1, 1); 291 } 292 293 static void kbc_dbb_out_aux(PPDMDEVINS pDevIns, PKBDSTATE s, uint8_t val) 294 294 { 295 295 s->dbbout = val; … … 297 297 s->status |= KBD_STAT_OBF | KBD_STAT_MOUSE_OBF; 298 298 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); 300 300 } 301 301 … … 307 307 switch(val) { 308 308 case KBD_CCMD_READ_MODE: 309 kbc_dbb_out( s, s->mode);309 kbc_dbb_out(pDevIns, s, s->mode); 310 310 break; 311 311 case KBD_CCMD_WRITE_MODE: … … 325 325 break; 326 326 case KBD_CCMD_TEST_MOUSE: 327 kbc_dbb_out( s, 0x00);327 kbc_dbb_out(pDevIns, s, 0x00); 328 328 break; 329 329 case KBD_CCMD_SELF_TEST: 330 330 /* Enable the A20 line - that is the power-on state(!). */ 331 331 # ifndef IN_RING3 332 if (!PDMDevHlpA20IsEnabled( s->CTX_SUFF(pDevIns)))332 if (!PDMDevHlpA20IsEnabled(pDevIns)) 333 333 return VINF_IOM_R3_IOPORT_WRITE; 334 334 # else /* IN_RING3 */ 335 PDMDevHlpA20Set( s->CTX_SUFF(pDevIns), true);335 PDMDevHlpA20Set(pDevIns, true); 336 336 # endif /* IN_RING3 */ 337 337 s->status |= KBD_STAT_SELFTEST; 338 338 s->mode |= KBD_MODE_DISABLE_KBD; 339 kbc_dbb_out( s, 0x55);339 kbc_dbb_out(pDevIns, s, 0x55); 340 340 break; 341 341 case KBD_CCMD_KBD_TEST: 342 kbc_dbb_out( s, 0x00);342 kbc_dbb_out(pDevIns, s, 0x00); 343 343 break; 344 344 case KBD_CCMD_KBD_DISABLE: … … 351 351 break; 352 352 case KBD_CCMD_READ_INPORT: 353 kbc_dbb_out( s, 0xBF);353 kbc_dbb_out(pDevIns, s, 0xBF); 354 354 break; 355 355 case KBD_CCMD_READ_OUTPORT: 356 356 /* XXX: check that */ 357 357 #ifdef TARGET_I386 358 val = 0x01 | (PDMDevHlpA20IsEnabled( s->CTX_SUFF(pDevIns)) << 1);358 val = 0x01 | (PDMDevHlpA20IsEnabled(pDevIns) << 1); 359 359 #else 360 360 val = 0x01; … … 364 364 if (s->status & KBD_STAT_MOUSE_OBF) 365 365 val |= 0x20; 366 kbc_dbb_out( s, val);366 kbc_dbb_out(pDevIns, s, val); 367 367 break; 368 368 #ifdef TARGET_I386 369 369 case KBD_CCMD_ENABLE_A20: 370 370 # ifndef IN_RING3 371 if (!PDMDevHlpA20IsEnabled( s->CTX_SUFF(pDevIns)))371 if (!PDMDevHlpA20IsEnabled(pDevIns)) 372 372 return VINF_IOM_R3_IOPORT_WRITE; 373 373 # else /* IN_RING3 */ 374 PDMDevHlpA20Set( s->CTX_SUFF(pDevIns), true);374 PDMDevHlpA20Set(pDevIns, true); 375 375 # endif /* IN_RING3 */ 376 376 break; 377 377 case KBD_CCMD_DISABLE_A20: 378 378 # ifndef IN_RING3 379 if (PDMDevHlpA20IsEnabled( s->CTX_SUFF(pDevIns)))379 if (PDMDevHlpA20IsEnabled(pDevIns)) 380 380 return VINF_IOM_R3_IOPORT_WRITE; 381 381 # else /* IN_RING3 */ 382 PDMDevHlpA20Set( s->CTX_SUFF(pDevIns), false);382 PDMDevHlpA20Set(pDevIns, false); 383 383 # endif /* IN_RING3 */ 384 384 break; … … 387 387 /* Keyboard clock line is zero IFF keyboard is disabled */ 388 388 val = (s->mode & KBD_MODE_DISABLE_KBD) ? 0 : 1; 389 kbc_dbb_out( s, val);389 kbc_dbb_out(pDevIns, s, val); 390 390 break; 391 391 case KBD_CCMD_RESET: … … 395 395 #else /* IN_RING3 */ 396 396 LogRel(("Reset initiated by keyboard controller\n")); 397 return PDMDevHlpVMReset( s->CTX_SUFF(pDevIns), PDMVMRESET_F_KBD);397 return PDMDevHlpVMReset(pDevIns, PDMVMRESET_F_KBD); 398 398 #endif /* IN_RING3 */ 399 399 case 0xff: … … 409 409 case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: 410 410 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); 412 412 Log(("kbd: reading non-standard RAM addr %#x\n", val & 0x1f)); 413 413 break; … … 428 428 /* Reading the DBB deasserts IRQs... */ 429 429 if (s->status & KBD_STAT_MOUSE_OBF) 430 PDMDevHlpISASetIrq( s->CTX_SUFF(pDevIns), 12, 0);430 PDMDevHlpISASetIrq(pDevIns, 12, 0); 431 431 else 432 PDMDevHlpISASetIrq( s->CTX_SUFF(pDevIns), 1, 0);432 PDMDevHlpISASetIrq(pDevIns, 1, 0); 433 433 /* ...and clears the OBF bits. */ 434 434 s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF); … … 476 476 break; 477 477 case KBD_CCMD_WRITE_OBUF: 478 kbc_dbb_out( s, val);478 kbc_dbb_out(pDevIns, s, val); 479 479 break; 480 480 case KBD_CCMD_WRITE_AUX_OBUF: 481 kbc_dbb_out_aux( s, val);481 kbc_dbb_out_aux(pDevIns, s, val); 482 482 break; 483 483 case KBD_CCMD_WRITE_OUTPORT: 484 484 #ifdef TARGET_I386 485 485 # ifndef IN_RING3 486 if (PDMDevHlpA20IsEnabled( s->CTX_SUFF(pDevIns)) != !!(val & 2))486 if (PDMDevHlpA20IsEnabled(pDevIns) != !!(val & 2)) 487 487 rc = VINF_IOM_R3_IOPORT_WRITE; 488 488 # else /* IN_RING3 */ 489 PDMDevHlpA20Set( s->CTX_SUFF(pDevIns), !!(val & 2));489 PDMDevHlpA20Set(pDevIns, !!(val & 2)); 490 490 # endif /* IN_RING3 */ 491 491 #endif … … 494 494 rc = VINF_IOM_R3_IOPORT_WRITE; 495 495 # else 496 rc = PDMDevHlpVMReset( s->CTX_SUFF(pDevIns), PDMVMRESET_F_KBD);496 rc = PDMDevHlpVMReset(pDevIns, PDMVMRESET_F_KBD); 497 497 # endif 498 498 } … … 1018 1018 1019 1019 /* 1020 * Initialize the interfaces.1020 * Initialize the sub-components. 1021 1021 */ 1022 pThis->pDevInsR3 = pDevIns;1023 pThis->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);1024 pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);1025 1026 1022 rc = PS2KR3Construct(&pThis->Kbd, pDevIns, pThis, iInstance, pCfg); 1027 1023 AssertRCReturn(rc, rc); -
trunk/src/VBox/Devices/Input/DevPS2.h
r82201 r82203 334 334 int32_t xlat_state; 335 335 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 343 336 /** I/O port 60h. */ 344 337 IOMIOPORTHANDLE hIoPortData;
Note:
See TracChangeset
for help on using the changeset viewer.