VirtualBox

Changeset 55077 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 1, 2015 2:14:31 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99369
Message:

PS2K: group IN_RING3 code.

File:
1 edited

Legend:

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

    r55076 r55077  
    552552}
    553553
     554/**
     555 * Notify listener about LEDs state change.
     556 *
     557 * @param   pThis           The PS/2 keyboard instance data.
     558 * @param   u8State         Bitfield which reflects LEDs state.
     559 */
     560static void ps2kNotifyLedsState(PPS2K pThis, uint8_t u8State)
     561{
     562
     563    PDMKEYBLEDS enmLeds = PDMKEYBLEDS_NONE;
     564
     565    if (u8State & 0x01)
     566        enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_SCROLLLOCK);
     567    if (u8State & 0x02)
     568        enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_NUMLOCK);
     569    if (u8State & 0x04)
     570        enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_CAPSLOCK);
     571
     572    pThis->Keyboard.pDrv->pfnLedStatusChange(pThis->Keyboard.pDrv, enmLeds);
     573
     574}
    554575#endif /* IN_RING3 */
    555576
     
    610631    /* Clear last typematic key?? */
    611632}
    612 
    613 #ifdef IN_RING3
    614 /**
    615  * Notify listener about LEDs state change.
    616  *
    617  * @param   pThis           The PS/2 keyboard instance data.
    618  * @param   u8State         Bitfield which reflects LEDs state.
    619  */
    620 static void ps2kNotifyLedsState(PPS2K pThis, uint8_t u8State)
    621 {
    622 
    623     PDMKEYBLEDS enmLeds = PDMKEYBLEDS_NONE;
    624 
    625     if (u8State & 0x01)
    626         enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_SCROLLLOCK);
    627     if (u8State & 0x02)
    628         enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_NUMLOCK);
    629     if (u8State & 0x04)
    630         enmLeds = (PDMKEYBLEDS)(enmLeds | PDMKEYBLEDS_CAPSLOCK);
    631 
    632     pThis->Keyboard.pDrv->pfnLedStatusChange(pThis->Keyboard.pDrv, enmLeds);
    633 
    634 }
    635 #endif /* IN_RING3 */
    636633
    637634/**
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette