VirtualBox

Changeset 69704 in vbox for trunk


Ignore:
Timestamp:
Nov 15, 2017 1:05:01 PM (7 years ago)
Author:
vboxsync
Message:

DevPS2: They really do think different! Darwin 6.0.2 and earlier reads a DWORD to get one byte from the KBC.

File:
1 edited

Legend:

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

    r69500 r69704  
    661661PDMBOTHCBDECL(int) kbdIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    662662{
     663    uint32_t    fluff = 0;
     664    KBDState    *pThis = PDMINS_2_DATA(pDevIns, KBDState *);
     665
    663666    NOREF(pvUser);
    664     if (cb == 1)
    665     {
    666         KBDState *pThis = PDMINS_2_DATA(pDevIns, KBDState *);
    667         *pu32 = kbd_read_data(pThis, Port);
     667    switch (cb) {
     668    case 4:
     669        fluff |= 0xffff0000;    /* Crazy Apple (Darwin 6.0.2 and earlier). */
     670        RT_FALL_THRU();
     671    case 2:
     672        fluff |= 0x0000ff00;
     673        RT_FALL_THRU();
     674    case 1:
     675        *pu32 = fluff | kbd_read_data(pThis, Port);
    668676        Log2(("kbdIOPortDataRead: Port=%#x cb=%d *pu32=%#x\n", Port, cb, *pu32));
    669677        return VINF_SUCCESS;
    670     }
    671     AssertMsgFailed(("Port=%#x cb=%d\n", Port, cb));
    672     return VERR_IOM_IOPORT_UNUSED;
     678    default:
     679        AssertMsgFailed(("Port=%#x cb=%d\n", Port, cb));
     680        return VERR_IOM_IOPORT_UNUSED;
     681    }
    673682}
    674683
     
    712721PDMBOTHCBDECL(int) kbdIOPortStatusRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    713722{
    714     uint16_t    fluff = 0;
     723    uint32_t    fluff = 0;
    715724    KBDState    *pThis = PDMINS_2_DATA(pDevIns, KBDState *);
    716725
    717726    NOREF(pvUser);
    718727    switch (cb) {
     728    case 4:
     729        fluff |= 0xffff0000;    /* Crazy Apple (Darwin 6.0.2 and earlier). */
     730        RT_FALL_THRU();
    719731    case 2:
    720         fluff = 0xff00;
     732        fluff |= 0x0000ff00;
    721733        RT_FALL_THRU();
    722734    case 1:
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