Changeset 42324 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Jul 23, 2012 1:42:08 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r41825 r42324 5955 5955 if (rc != VINF_SUCCESS) 5956 5956 return rc; 5957 if (cb == 1) 5958 rc = ataIOPortWriteU8(pCtl, Port, u32); 5959 else if (Port == pCtl->IOPortBase1) 5960 { 5957 if (Port == pCtl->IOPortBase1) 5958 { 5959 /* Writes to the data port may be 16-bit or 32-bit. */ 5961 5960 Assert(cb == 2 || cb == 4); 5962 5961 rc = ataDataWrite(pCtl, Port, cb, (const uint8_t *)&u32); 5963 5962 } 5964 5963 else 5965 AssertMsgFailed(("ataIOPortWrite1: unsupported write to port %x val=%x size=%d\n", Port, u32, cb)); 5964 { 5965 /* Writes to the other command block ports should be 8-bit only. If they 5966 * are not, the high bits are simply discarded. Undocumented, but observed 5967 * on a real PIIX4 system. 5968 */ 5969 if (cb > 1) 5970 Log(("ataIOPortWrite1: suspect write to port %x val=%x size=%d\n", Port, u32, cb)); 5971 5972 rc = ataIOPortWriteU8(pCtl, Port, u32); 5973 } 5966 5974 PDMCritSectLeave(&pCtl->lock); 5967 5975 return rc; … … 5985 5993 if (rc != VINF_SUCCESS) 5986 5994 return rc; 5987 if (cb == 1) 5988 { 5989 rc = ataIOPortReadU8(pCtl, Port, pu32); 5990 } 5991 else if (Port == pCtl->IOPortBase1) 5992 { 5995 if (Port == pCtl->IOPortBase1) 5996 { 5997 /* Reads from the data register may be 16-bit or 32-bit. */ 5993 5998 Assert(cb == 2 || cb == 4); 5994 5999 rc = ataDataRead(pCtl, Port, cb, (uint8_t *)pu32); … … 5998 6003 else 5999 6004 { 6000 AssertMsgFailed(("ataIOPortRead1: unsupported read from port %x size=%d\n", Port, cb)); 6001 rc = VERR_IOM_IOPORT_UNUSED; 6005 /* Reads from the other command block registers should be 8-bit only. 6006 * If they are not, the low byte is propagated to the high bits. 6007 * Undocumented, but observed on a real PIIX4 system. 6008 */ 6009 rc = ataIOPortReadU8(pCtl, Port, pu32); 6010 if (cb > 1) 6011 { 6012 uint32_t pad; 6013 6014 /* Replicate the 8-bit result into the upper three bytes. */ 6015 pad = *pu32 & 0xff; 6016 pad = pad | (pad << 8); 6017 pad = pad | (pad << 16); 6018 *pu32 = pad; 6019 Log(("ataIOPortRead1: suspect read from port %x size=%d\n", Port, cb)); 6020 } 6002 6021 } 6003 6022 PDMCritSectLeave(&pCtl->lock);
Note:
See TracChangeset
for help on using the changeset viewer.