|
openMSX
|
#include <AbstractIDEDevice.hh>


Public Member Functions | |
| virtual void | reset (EmuTime::param time) |
| virtual word | readData (EmuTime::param time) |
| virtual byte | readReg (nibble reg, EmuTime::param time) |
| virtual void | writeData (word value, EmuTime::param time) |
| virtual void | writeReg (nibble reg, byte value, EmuTime::param time) |
| template<typename Archive > | |
| void | serialize (Archive &ar, unsigned version) |
Public Member Functions inherited from openmsx::IDEDevice | |
| virtual | ~IDEDevice () |
Protected Member Functions | |
| AbstractIDEDevice (MSXMotherBoard &motherBoard) | |
| virtual | ~AbstractIDEDevice () |
| virtual bool | isPacketDevice ()=0 |
| Is this device a packet (ATAPI) device? | |
| virtual const std::string & | getDeviceName ()=0 |
| Gets the device name to insert as "model number" into the identify block. | |
| virtual void | fillIdentifyBlock (byte *buffer)=0 |
| Tells a subclass to fill the device specific parts of the identify block located in the buffer. | |
| virtual unsigned | readBlockStart (byte *buffer, unsigned count)=0 |
| Called when a block of read data should be buffered by the controller: when the buffer is empty or at the start of the transfer. | |
| virtual void | readEnd () |
| Called when a read transfer completes. | |
| virtual void | writeBlockComplete (byte *buffer, unsigned count)=0 |
| Called when a block of written data has been buffered by the controller: when the buffer is full or at the end of the transfer. | |
| virtual void | executeCommand (byte cmd) |
| Starts execution of an IDE command. | |
| void | setError (byte error) |
| Indicates an error: sets error register, error flag, aborts transfers. | |
| unsigned | getSectorNumber () const |
| Creates an LBA sector address from the contents of the sectorNumReg, cylinderLowReg, cylinderHighReg and devHeadReg registers. | |
| unsigned | getNumSectors () const |
| Gets the number of sectors indicated by the sector count register. | |
| void | setInterruptReason (byte value) |
| Writes the interrupt reason register. | |
| unsigned | getByteCount () |
| Reads the byte count limit of a packet transfer in the registers. | |
| void | setByteCount (unsigned count) |
| Writes the byte count of a packet transfer in the registers. | |
| void | setSectorNumber (unsigned lba) |
| Writes a 28-bit LBA sector number in the registers. | |
| void | startLongReadTransfer (unsigned count) |
| Indicates the start of a read data transfer which uses blocks. | |
| byte * | startShortReadTransfer (unsigned count) |
| Indicates the start of a read data transfer where all data fits into the buffer at once. | |
| void | abortReadTransfer (byte error) |
| Aborts the read transfer in progress. | |
| void | startWriteTransfer (unsigned count) |
| Indicates the start of a write data transfer. | |
| void | abortWriteTransfer (byte error) |
| Aborts the write transfer in progress. | |
| byte | getFeatureReg () const |
| void | setLBALow (byte value) |
| void | setLBAMid (byte value) |
| void | setLBAHigh (byte value) |
Static Protected Attributes | |
| static const byte | DRDY = 0x40 |
| static const byte | DSC = 0x10 |
| static const byte | DRQ = 0x08 |
| static const byte | ERR = 0x01 |
| static const byte | UNC = 0x40 |
| static const byte | IDNF = 0x10 |
| static const byte | ABORT = 0x04 |
Definition at line 12 of file AbstractIDEDevice.hh.
|
explicitprotected |
Definition at line 13 of file AbstractIDEDevice.cc.
|
protectedvirtual |
Definition at line 26 of file AbstractIDEDevice.cc.
|
protected |
Aborts the read transfer in progress.
Definition at line 372 of file AbstractIDEDevice.cc.
References ABORT, and setError().
Referenced by openmsx::IDECDROM::readBlockStart().
|
protected |
Aborts the write transfer in progress.
Definition at line 386 of file AbstractIDEDevice.cc.
References ABORT, and setError().
|
protectedvirtual |
Starts execution of an IDE command.
Override this to implement additional commands and make sure you call the superclass implementation for all commands that you don't handle.
Definition at line 287 of file AbstractIDEDevice.cc.
References ABORT, DRDY, DSC, getFeatureReg(), isPacketDevice(), setError(), and startShortReadTransfer().
Referenced by writeReg().
|
protectedpure virtual |
Tells a subclass to fill the device specific parts of the identify block located in the buffer.
The generic part is already written there.
| buffer | Array of 512 bytes. |
|
protected |
Reads the byte count limit of a packet transfer in the registers.
The cylinder low/high registers are used for this.
Definition at line 264 of file AbstractIDEDevice.cc.
Referenced by openmsx::IDECDROM::executeCommand().
|
protectedpure virtual |
Gets the device name to insert as "model number" into the identify block.
|
inlineprotected |
Definition at line 153 of file AbstractIDEDevice.hh.
Referenced by openmsx::IDECDROM::executeCommand(), and executeCommand().
|
protected |
Gets the number of sectors indicated by the sector count register.
Definition at line 254 of file AbstractIDEDevice.cc.
|
protected |
Creates an LBA sector address from the contents of the sectorNumReg, cylinderLowReg, cylinderHighReg and devHeadReg registers.
Definition at line 248 of file AbstractIDEDevice.cc.
|
protectedpure virtual |
Is this device a packet (ATAPI) device?
Referenced by executeCommand().
|
protectedpure virtual |
Called when a block of read data should be buffered by the controller: when the buffer is empty or at the start of the transfer.
| buffer | Pointer to the start of a byte array. |
| count | Number of bytes to be filled by this method. This number will not exceed the array size nor the transfer length. |
|
virtual |
Implements openmsx::IDEDevice.
Definition at line 167 of file AbstractIDEDevice.cc.
|
protectedvirtual |
Called when a read transfer completes.
The default implementation does nothing.
Definition at line 283 of file AbstractIDEDevice.cc.
Referenced by readData().
|
virtual |
Implements openmsx::IDEDevice.
Definition at line 71 of file AbstractIDEDevice.cc.
References UNREACHABLE.
|
virtual |
Implements openmsx::IDEDevice.
Definition at line 61 of file AbstractIDEDevice.cc.
| void openmsx::AbstractIDEDevice::serialize | ( | Archive & | ar, |
| unsigned | version | ||
| ) |
Definition at line 448 of file AbstractIDEDevice.cc.
|
protected |
Writes the byte count of a packet transfer in the registers.
The cylinder low/high registers are used for this.
Definition at line 269 of file AbstractIDEDevice.cc.
|
protected |
Indicates an error: sets error register, error flag, aborts transfers.
| error | Value to be written to the error register. |
Definition at line 235 of file AbstractIDEDevice.cc.
Referenced by abortReadTransfer(), abortWriteTransfer(), openmsx::IDECDROM::executeCommand(), and executeCommand().
|
protected |
Writes the interrupt reason register.
This is the same as register as sector count, but serves a different purpose.
Definition at line 259 of file AbstractIDEDevice.cc.
Referenced by openmsx::IDECDROM::executeCommand(), and openmsx::IDECDROM::readEnd().
|
inlineprotected |
Definition at line 156 of file AbstractIDEDevice.hh.
Referenced by openmsx::IDECDROM::executeCommand().
|
inlineprotected |
Definition at line 154 of file AbstractIDEDevice.hh.
|
inlineprotected |
Definition at line 155 of file AbstractIDEDevice.hh.
Referenced by openmsx::IDECDROM::executeCommand().
|
protected |
Writes a 28-bit LBA sector number in the registers.
The cylinder low/high registers are used for this.
Definition at line 275 of file AbstractIDEDevice.cc.
|
protected |
Indicates the start of a read data transfer which uses blocks.
The readBlockStart() method is called at the start of each block. The first block will be read immediately, so make sure you initialise all variables needed by readBlockStart() before calling this method.
| count | Total number of bytes to transfer. |
Definition at line 358 of file AbstractIDEDevice.cc.
|
protected |
Indicates the start of a read data transfer where all data fits into the buffer at once.
| count | Total number of bytes to transfer. |
Definition at line 345 of file AbstractIDEDevice.cc.
Referenced by executeCommand().
|
protected |
Indicates the start of a write data transfer.
| count | Total number of bytes to transfer. |
Definition at line 378 of file AbstractIDEDevice.cc.
References DRQ.
Referenced by openmsx::IDECDROM::executeCommand().
|
protectedpure virtual |
Called when a block of written data has been buffered by the controller: when the buffer is full or at the end of the transfer.
| buffer | Pointer to the start of a byte array. |
| count | Number of data bytes in the array. |
Referenced by writeData().
|
virtual |
Implements openmsx::IDEDevice.
Definition at line 201 of file AbstractIDEDevice.cc.
References DRQ, and writeBlockComplete().
|
virtual |
Implements openmsx::IDEDevice.
Definition at line 113 of file AbstractIDEDevice.cc.
References DRQ, ERR, executeCommand(), and UNREACHABLE.
|
staticprotected |
Definition at line 36 of file AbstractIDEDevice.hh.
Referenced by abortReadTransfer(), abortWriteTransfer(), and executeCommand().
|
staticprotected |
Definition at line 28 of file AbstractIDEDevice.hh.
Referenced by executeCommand(), and reset().
|
staticprotected |
Definition at line 30 of file AbstractIDEDevice.hh.
Referenced by readData(), setError(), startWriteTransfer(), writeData(), and writeReg().
|
staticprotected |
Definition at line 29 of file AbstractIDEDevice.hh.
Referenced by executeCommand(), and reset().
|
staticprotected |
Definition at line 31 of file AbstractIDEDevice.hh.
Referenced by setError(), and writeReg().
|
staticprotected |
Definition at line 35 of file AbstractIDEDevice.hh.
|
staticprotected |
Definition at line 34 of file AbstractIDEDevice.hh.
1.8.1.2