#include <AliM1543C_ide.h>


Documentation consulted:
Definition at line 162 of file AliM1543C_ide.h.
Public Member Functions | |
| CAliM1543C_ide (CConfigurator *cfg, class CSystem *c, int pcibus, int pcidev) | |
| Constructor. | |
| virtual | ~CAliM1543C_ide () |
| virtual void | register_disk (class CDisk *dsk, int bus, int dev) |
| virtual void | WriteMem_Legacy (int index, u32 address, int dsize, u32 data) |
| virtual u32 | ReadMem_Legacy (int index, u32 address, int dsize) |
| virtual void | WriteMem_Bar (int func, int bar, u32 address, int dsize, u32 data) |
| virtual u32 | ReadMem_Bar (int func, int bar, u32 address, int dsize) |
| virtual int | SaveState (FILE *f) |
| Save state to a Virtual Machine State file. | |
| virtual int | RestoreState (FILE *f) |
| Restore state from a Virtual Machine State file. | |
| virtual void | check_state () |
| Check if threads are still running. | |
| virtual void | ResetPCI () |
| virtual void | run () |
| Thread entry point. | |
| virtual void | init () |
| Initialize the IDE device. | |
| virtual void | start_threads () |
| virtual void | stop_threads () |
Private Member Functions | |
| u32 | ide_command_read (int channel, u32 address, int dsize) |
| void | ide_command_write (int channel, u32 address, int dsize, u32 data) |
| u32 | ide_control_read (int channel, u32 address) |
| void | ide_control_write (int channel, u32 address, u32 data) |
| Write to the IDE controller control interface. | |
| u32 | ide_busmaster_read (int channel, u32 address, int dsize) |
| Read from the IDE controller busmaster interface. | |
| void | ide_busmaster_write (int channel, u32 address, u32 data, int dsize) |
| Write to the IDE controller busmaster interface. | |
| int | do_dma_transfer (int index, u8 *buffer, u32 size, bool direction) |
| void | raise_interrupt (int channel) |
| void | set_signature (int channel, int id) |
| u8 | get_status (int index) |
| void | command_aborted (int index, u8 command) |
| void | identify_drive (int index, bool packet) |
| void | ide_status (int index) |
| void | execute (int index) |
Private Attributes | |
| Poco::Thread * | thrController [2] |
| Poco::Semaphore * | semController [2] |
| Poco::Semaphore * | semBusMaster [2] |
| CRWMutex * | mtRegisters [2] |
| CRWMutex * | mtBusMaster [2] |
| bool | StopThread |
| bool | usedma |
| struct CAliM1543C_ide::SAliM1543C_ideState | state |
Data Structures | |
| struct | SAliM1543C_ideState |
| CAliM1543C_ide::CAliM1543C_ide | ( | CConfigurator * | cfg, | |
| class CSystem * | c, | |||
| int | pcibus, | |||
| int | pcidev | |||
| ) |
Constructor.
Definition at line 298 of file AliM1543C_ide.cpp.
References FAILURE, CSCSIDevice::scsi_register(), and theIDE.
| CAliM1543C_ide::~CAliM1543C_ide | ( | ) | [virtual] |
| void CAliM1543C_ide::register_disk | ( | class CDisk * | dsk, | |
| int | bus, | |||
| int | dev | |||
| ) | [virtual] |
Reimplemented from CDiskController.
Definition at line 417 of file AliM1543C_ide.cpp.
References CDisk::cdrom(), CDiskController::register_disk(), CSCSIDevice::scsi_bus, CSCSIDevice::scsi_register(), and CDisk::set_atapi_mode().
Reimplemented from CPCIDevice.
Definition at line 543 of file AliM1543C_ide.cpp.
References ide_busmaster_write(), ide_command_write(), ide_control_write(), PRI_BUSMASTER, PRI_COMMAND, PRI_CONTROL, SEC_BUSMASTER, SEC_COMMAND, and SEC_CONTROL.
Reimplemented from CPCIDevice.
Definition at line 516 of file AliM1543C_ide.cpp.
References ide_busmaster_read(), ide_command_read(), ide_control_read(), PRI_BUSMASTER, PRI_COMMAND, PRI_CONTROL, SEC_BUSMASTER, SEC_COMMAND, and SEC_CONTROL.
Reimplemented from CPCIDevice.
Definition at line 600 of file AliM1543C_ide.cpp.
References BAR_BUSMASTER, BAR_PRI_COMMAND, BAR_PRI_CONTROL, BAR_SEC_COMMAND, BAR_SEC_CONTROL, ide_busmaster_write(), ide_command_write(), and ide_control_write().
Reimplemented from CPCIDevice.
Definition at line 571 of file AliM1543C_ide.cpp.
References BAR_BUSMASTER, BAR_PRI_COMMAND, BAR_PRI_CONTROL, BAR_SEC_COMMAND, BAR_SEC_CONTROL, ide_busmaster_read(), ide_command_read(), and ide_control_read().
| int CAliM1543C_ide::SaveState | ( | FILE * | f | ) | [virtual] |
Save state to a Virtual Machine State file.
Reimplemented from CPCIDevice.
Definition at line 433 of file AliM1543C_ide.cpp.
References CSystemComponent::devid_string, ide_magic1, ide_magic2, CPCIDevice::SaveState(), and state.
| int CAliM1543C_ide::RestoreState | ( | FILE * | f | ) | [virtual] |
Restore state from a Virtual Machine State file.
Reimplemented from CPCIDevice.
Definition at line 452 of file AliM1543C_ide.cpp.
References CSystemComponent::devid_string, ide_magic1, ide_magic2, CPCIDevice::RestoreState(), and state.
| void CAliM1543C_ide::check_state | ( | ) | [virtual] |
Check if threads are still running.
Reimplemented from CSystemComponent.
Definition at line 1443 of file AliM1543C_ide.cpp.
References FAILURE, and thrController.
| void CAliM1543C_ide::ResetPCI | ( | ) | [virtual] |
Reimplemented from CPCIDevice.
Definition at line 388 of file AliM1543C_ide.cpp.
References COMMAND, CONTROLLER, PER_DRIVE, REGISTERS, CPCIDevice::ResetPCI(), set_signature(), and STATUS.
Referenced by init().
| void CAliM1543C_ide::run | ( | void | ) | [virtual] |
Thread entry point.
Implements Poco::Runnable.
Definition at line 2622 of file AliM1543C_ide.cpp.
References CONTROLLER, Poco::Thread::current(), Poco::Exception::displayText(), execute(), ide_status(), mtBusMaster, CAliM1543C::pic_interrupt(), SCOPED_WRITE_LOCK, SEL_COMMAND, semController, StopThread, theAli, thrController, UPDATE_ALT_STATUS, and Poco::Semaphore::wait().
| void CAliM1543C_ide::init | ( | ) | [virtual] |
Initialize the IDE device.
Reimplemented from CSystemComponent.
Definition at line 315 of file AliM1543C_ide.cpp.
References CPCIDevice::add_function(), CPCIDevice::add_legacy_io(), AliM1543C_ide_cfg_data, AliM1543C_ide_cfg_mask, CConfigurator::get_bool_value(), mtBusMaster, mtRegisters, CSystemComponent::myCfg, PRI_BUSMASTER, PRI_COMMAND, PRI_CONTROL, ResetPCI(), SEC_BUSMASTER, SEC_COMMAND, SEC_CONTROL, semBusMaster, semController, StopThread, thrController, and usedma.
| void CAliM1543C_ide::start_threads | ( | ) | [virtual] |
Reimplemented from CSystemComponent.
Definition at line 351 of file AliM1543C_ide.cpp.
References Poco::Thread::start(), StopThread, and thrController.
| void CAliM1543C_ide::stop_threads | ( | ) | [virtual] |
Reimplemented from CSystemComponent.
Definition at line 367 of file AliM1543C_ide.cpp.
References Poco::Thread::join(), semController, Poco::Semaphore::set(), StopThread, and thrController.
Referenced by ~CAliM1543C_ide().
Definition at line 632 of file AliM1543C_ide.cpp.
References CONTROLLER, CDiskController::get_disk(), get_status(), IDE_BUFFER_SIZE, ide_status(), PAUSE, CAliM1543C::pic_deassert(), REG_COMMAND_CYL_HI, REG_COMMAND_CYL_LOW, REG_COMMAND_DATA, REG_COMMAND_DRIVE, REG_COMMAND_ERROR, REG_COMMAND_SECTOR_COUNT, REG_COMMAND_SECTOR_NO, REG_COMMAND_STATUS, register_names, SEL_COMMAND, SEL_REGISTERS, SEL_STATUS, semController, Poco::Semaphore::set(), theAli, and UPDATE_ALT_STATUS.
Referenced by ReadMem_Bar(), and ReadMem_Legacy().
Definition at line 743 of file AliM1543C_ide.cpp.
References command_aborted(), CONTROLLER, IDE_BUFFER_SIZE, ide_status(), PACKET_NONE, PAUSE, CAliM1543C::pic_deassert(), REG_COMMAND_COMMAND, REG_COMMAND_CYL_HI, REG_COMMAND_CYL_LOW, REG_COMMAND_DATA, REG_COMMAND_DRIVE, REG_COMMAND_FEATURES, REG_COMMAND_SECTOR_COUNT, REG_COMMAND_SECTOR_NO, register_names, REGISTERS, SEL_COMMAND, SEL_DISK, SEL_STATUS, semController, Poco::Semaphore::set(), theAli, and UPDATE_ALT_STATUS.
Referenced by WriteMem_Bar(), and WriteMem_Legacy().
Definition at line 895 of file AliM1543C_ide.cpp.
References CONTROLLER, mtRegisters, SCOPED_READ_LOCK, SEL_REGISTERS, and SEL_STATUS.
Referenced by ReadMem_Bar(), and ReadMem_Legacy().
Write to the IDE controller control interface.
Definition at line 936 of file AliM1543C_ide.cpp.
References COMMAND, CONTROLLER, SEL_REGISTERS, set_signature(), and STATUS.
Referenced by WriteMem_Bar(), and WriteMem_Legacy().
Read from the IDE controller busmaster interface.
Definition at line 1001 of file AliM1543C_ide.cpp.
References CONTROLLER, and FAILURE.
Referenced by ReadMem_Bar(), and ReadMem_Legacy().
| void CAliM1543C_ide::ide_busmaster_write | ( | int | channel, | |
| u32 | address, | |||
| u32 | data, | |||
| int | dsize | |||
| ) | [private] |
Write to the IDE controller busmaster interface.
Definition at line 1029 of file AliM1543C_ide.cpp.
References CONTROLLER, CPCIDevice::do_pci_read(), endian_32, LL, semBusMaster, and Poco::Semaphore::set().
Referenced by WriteMem_Bar(), and WriteMem_Legacy().
Definition at line 2518 of file AliM1543C_ide.cpp.
References CONTROLLER, CPCIDevice::do_pci_read(), CPCIDevice::do_pci_write(), endian_32, FAILURE, mtBusMaster, raise_interrupt(), SCOPED_READ_LOCK, SCOPED_WRITE_LOCK, semBusMaster, Poco::Semaphore::wait(), and xfer.
Referenced by execute().
| void CAliM1543C_ide::raise_interrupt | ( | int | channel | ) | [private] |
Definition at line 1154 of file AliM1543C_ide.cpp.
References CONTROLLER, mtBusMaster, CAliM1543C::pic_interrupt(), SCOPED_WRITE_LOCK, theAli, and UPDATE_ALT_STATUS.
Referenced by command_aborted(), do_dma_transfer(), and execute().
| void CAliM1543C_ide::set_signature | ( | int | channel, | |
| int | id | |||
| ) | [private] |
Definition at line 1129 of file AliM1543C_ide.cpp.
References CONTROLLER, CDiskController::get_disk(), and REGISTERS.
Referenced by execute(), ide_control_write(), and ResetPCI().
| u8 CAliM1543C_ide::get_status | ( | int | index | ) | [private] |
Definition at line 1175 of file AliM1543C_ide.cpp.
References CONTROLLER, SEL_DISK, and SEL_STATUS.
Referenced by ide_command_read().
| void CAliM1543C_ide::command_aborted | ( | int | index, | |
| u8 | command | |||
| ) | [private] |
Definition at line 1400 of file AliM1543C_ide.cpp.
References CONTROLLER, raise_interrupt(), SEL_COMMAND, SEL_REGISTERS, SEL_STATUS, and UPDATE_ALT_STATUS.
Referenced by execute(), and ide_command_write().
| void CAliM1543C_ide::identify_drive | ( | int | index, | |
| bool | packet | |||
| ) | [private] |
Definition at line 1222 of file AliM1543C_ide.cpp.
References CONTROLLER, MAX_MULTIPLE_SECTORS, SEL_DISK, SEL_PER_DRIVE, and usedma.
Referenced by execute().
| void CAliM1543C_ide::ide_status | ( | int | index | ) | [private] |
Definition at line 1417 of file AliM1543C_ide.cpp.
References CONTROLLER, SEL_COMMAND, SEL_REGISTERS, and SEL_STATUS.
Referenced by execute(), ide_command_read(), ide_command_write(), and run().
| void CAliM1543C_ide::execute | ( | int | index | ) | [private] |
Definition at line 1451 of file AliM1543C_ide.cpp.
References BYTE_COUNT, command_aborted(), CONTROLLER, do_dma_transfer(), endian_16, FAILURE, FAILURE_1, IDE_BUFFER_SIZE, ide_status(), identify_drive(), IR_CD, IR_IO, PACKET_DI, PACKET_DP1, PACKET_DP2, PACKET_DP34, PACKET_NONE, packet_states, PAUSE, raise_interrupt(), REGISTERS, CSCSIDevice::scsi_arbitrate(), CSCSIDevice::scsi_expected_xfer(), CSCSIDevice::scsi_get_phase(), SCSI_PHASE_COMMAND, SCSI_PHASE_DATA_IN, SCSI_PHASE_DATA_OUT, SCSI_PHASE_FREE, SCSI_PHASE_STATUS, CSCSIDevice::scsi_select(), CSCSIDevice::scsi_xfer_done(), CSCSIDevice::scsi_xfer_ptr(), SEL_COMMAND, SEL_DISK, SEL_PER_DRIVE, SEL_REGISTERS, SEL_STATUS, and set_signature().
Referenced by run().
Poco::Thread* CAliM1543C_ide::thrController[2] [private] |
Definition at line 206 of file AliM1543C_ide.h.
Referenced by check_state(), init(), run(), start_threads(), and stop_threads().
Poco::Semaphore* CAliM1543C_ide::semController[2] [private] |
Definition at line 207 of file AliM1543C_ide.h.
Referenced by ide_command_read(), ide_command_write(), init(), run(), and stop_threads().
Poco::Semaphore* CAliM1543C_ide::semBusMaster[2] [private] |
Definition at line 208 of file AliM1543C_ide.h.
Referenced by do_dma_transfer(), ide_busmaster_write(), and init().
CRWMutex* CAliM1543C_ide::mtRegisters[2] [private] |
CRWMutex* CAliM1543C_ide::mtBusMaster[2] [private] |
Definition at line 210 of file AliM1543C_ide.h.
Referenced by do_dma_transfer(), init(), raise_interrupt(), and run().
bool CAliM1543C_ide::StopThread [private] |
Definition at line 211 of file AliM1543C_ide.h.
Referenced by init(), run(), start_threads(), and stop_threads().
bool CAliM1543C_ide::usedma [private] |
struct CAliM1543C_ide::SAliM1543C_ideState
CAliM1543C_ide::state [private] |
Referenced by RestoreState(), and SaveState().