X-1.22 Camiel Vanderhoeven 26-MAR-2008 Fix compiler warnings.
X-1.21 Camiel Vanderhoeven 24-MAR-2008 Comments.
X-1.20 Brian Wheeler 20-MAR-2008 1. Improved locking by a) Removing all of the general register locking; b) Busmaster locking is still in place, but it might not be needed, this locking is pretty fine grained so nothing should time out waiting for it; c) Creating an alt_status variable which gets updated when the real status becomes stable (i.e. at the end of the execute() run, after the drq status is changed, etc), access to this variable is locked; d) Everything else is a free for all. 3. Implement an optional delayed interrupt. The OSes still lose interrupts sometimes.
X-1.19 Brian Wheeler 17-MAR-2008 Fix some CD-ROM issues.
X-1.18 Camiel Vanderhoeven 14-MAR-2008 Formatting.
X-1.17 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.
X-1.16 Camiel Vanderhoeven 13-MAR-2008 Create init(), start_threads() and stop_threads() functions.
X-1.15 Brian Wheeler 12-MAR-2008 Better DMA support.
X-1.16 Camiel Vanderhoeven 11-MAR-2008 Named, debuggable mutexes.
X-1.15 Brian Wheeler 11-MAR-2008 Even nicer, more efficient multi-threading version.
X-1.14 Brian Wheeler 05-MAR-2008 Nicer, more efficient multi-threading version.
X-1.13 Camiel Vanderhoeven 05-MAR-2008 Multi-threading version.
X-1.12 Camiel Vanderhoeven 04-MAR-2008 Merged Brian wheeler's New IDE code into the standard controller.
X-1.11.4 Brian Wheeler 27-FEB-2008 Attempts to refire the interrupt if the controller seems to have missed it -- before the OS declares a timeout.
X-1.11.3 Camiel Vanderhoeven 12-JAN-2008 Use disk's SCSI engine for ATAPI devices.
X-1.11.2 Brian wheeler 08-JAN-2008 ATAPI improved.
X-1.11.1 Brian wheeler 08-JAN-2008 Complete rewrite of IDE controller.
X-1.11 Camiel Vanderhoeven 06-JAN-2008 Leave changing the blocksize to the disk itself.
X-1.10 Camiel Vanderhoeven 02-JAN-2008 Comments.
X-1.9 Camiel Vanderhoeven 28-DEC-2007 Only delay IDE interrupts when NO_VMS is defined. (Need to fix this properly).
X-1.8 Brian wheeler 19-DEC-2007 Added basic ATAPI support.
X-1.7 Brian wheeler 17-DEC-2007 Delayed IDE interrupts. (NetBSD requirement)
X-1.6 Camiel Vanderhoeven 17-DEC-2007 SaveState file format 2.1
X-1.5 Camiel Vanderhoeven 12-DEC-2007 Use disk controller base class.
X-1.4 Camiel Vanderhoeven 11-DEC-2007 Cleanup.
X-1.3 Camiel Vanderhoeven 11-DEC-2007 More complete IDE implementation allows NetBSD to recognize disks.
X-1.2 Brian Wheeler 10-DEC-2007 Fixed include case.
X-1.1 Camiel Vanderhoeven 10-DEC-2007 Initial version in CVS; this part was split off from the CAliM1543C class.
Definition in file AliM1543C_ide.h.
#include "DiskController.h"
#include "Configurator.h"
#include "SCSIDevice.h"
#include "SCSIBus.h"
Go to the source code of this file.
Data Structures | |
| class | CAliM1543C_ide |
| Emulated IDE part of ALi M1543C multi-function device. More... | |
| struct | CAliM1543C_ide::SAliM1543C_ideState |
| struct | CAliM1543C_ide::SAliM1543C_ideState::SDriveState |
| struct | CAliM1543C_ide::SAliM1543C_ideState::SControllerState |
Defines | |
| #define | INCLUDED_ALIM1543C_IDE_H_ |
| #define | MAX_MULTIPLE_SECTORS 128 |
| #define | IDE_BUFFER_SIZE 65536 |
| #define | SEL_STATUS(a) state.controller[a].drive[state.controller[a].selected].status |
| Status for selected drive on controller a. | |
| #define | SEL_COMMAND(a) state.controller[a].drive[state.controller[a].selected].command |
| Command for selected drive on controller a. | |
| #define | SEL_REGISTERS(a) state.controller[a].drive[state.controller[a].selected].registers |
| Registers for selected drive on controller a. | |
| #define | SEL_DISK(a) get_disk(a, state.controller[a].selected) |
| Selected drive on controller a. | |
| #define | SEL_PER_DRIVE(a) state.controller[a].drive[state.controller[a].selected] |
| Per-drive data for selected drive on controller a. | |
| #define | STATUS(a, b) state.controller[a].drive[b].status |
| #define | COMMAND(a, b) state.controller[a].drive[b].command |
| #define | REGISTERS(a, b) state.controller[a].drive[b].registers |
| #define | PER_DRIVE(a, b) state.controller[a].drive[b] |
| #define | CONTROLLER(a) state.controller[a] |
| #define | UPDATE_ALT_STATUS(a) |
| #define | PRI_COMMAND 1 |
| #define | PRI_CONTROL 2 |
| #define | SEC_COMMAND 3 |
| #define | SEC_CONTROL 4 |
| #define | PRI_BUSMASTER 5 |
| #define | SEC_BUSMASTER 6 |
| #define | BAR_PRI_COMMAND 0 |
| #define | BAR_PRI_CONTROL 1 |
| #define | BAR_SEC_COMMAND 2 |
| #define | BAR_SEC_CONTROL 3 |
| #define | BAR_BUSMASTER 4 |
| #define | REG_COMMAND_DATA 0 |
| #define | REG_COMMAND_ERROR 1 |
| #define | REG_COMMAND_FEATURES 1 |
| #define | REG_COMMAND_SECTOR_COUNT 2 |
| #define | REG_COMMAND_SECTOR_NO 3 |
| #define | REG_COMMAND_CYL_LOW 4 |
| #define | REG_COMMAND_CYL_HI 5 |
| #define | REG_COMMAND_DRIVE 6 |
| #define | REG_COMMAND_STATUS 7 |
| #define | REG_COMMAND_COMMAND 7 |
| #define | DMRD fault |
| #define | SERV seek_complete |
| #define | CHK err |
| #define | BYTE_COUNT cylinder_no |
| #define | REASON sector_count |
| #define | IR_CD 0x01 |
| #define | IR_IO 0x02 |
| #define | IR_REL 0x04 |
| #define | PACKET_NONE 0 |
| #define | PACKET_DP0 0 |
| #define | PACKET_DP1 1 |
| #define | PACKET_DP2 2 |
| #define | PACKET_DP34 3 |
| #define | PACKET_DI 4 |
| #define | SENSE_NONE 0x00 |
| #define | SENSE_RECOVERED_ERROR 0x01 |
| #define | SENSE_NOT_READY 0x02 |
| #define | SENSE_MEDIUM_ERROR 0x03 |
| #define | SENSE_HARDWARE_ERROR 0x04 |
| #define | SENSE_ILLEGAL_REQUEST 0x05 |
| #define | SENSE_UNIT_ATTENTION 0x06 |
| #define | SENSE_DATA_PROTECT 0x07 |
| #define | SENSE_BLANK_CHECK 0x08 |
| #define | SENSE_ABORT_COMMAND 0x0b |
| #define | SENSE_MISCOMPARE 0x0e |
Variables | |
| static const char * | register_names [] |
| static const char * | packet_states [] |
| CAliM1543C_ide * | theIDE |
| #define BAR_BUSMASTER 4 |
Definition at line 353 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ReadMem_Bar(), and CAliM1543C_ide::WriteMem_Bar().
| #define BAR_PRI_COMMAND 0 |
Definition at line 349 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ReadMem_Bar(), and CAliM1543C_ide::WriteMem_Bar().
| #define BAR_PRI_CONTROL 1 |
Definition at line 350 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ReadMem_Bar(), and CAliM1543C_ide::WriteMem_Bar().
| #define BAR_SEC_COMMAND 2 |
Definition at line 351 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ReadMem_Bar(), and CAliM1543C_ide::WriteMem_Bar().
| #define BAR_SEC_CONTROL 3 |
Definition at line 352 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ReadMem_Bar(), and CAliM1543C_ide::WriteMem_Bar().
| #define BYTE_COUNT cylinder_no |
| #define CHK err |
Definition at line 383 of file AliM1543C_ide.h.
| #define COMMAND | ( | a, | |||
| b | ) | state.controller[a].drive[b].command |
Definition at line 322 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_control_write(), and CAliM1543C_ide::ResetPCI().
| #define CONTROLLER | ( | a | ) | state.controller[a] |
Definition at line 331 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::command_aborted(), CAliM1543C_ide::do_dma_transfer(), CAliM1543C_ide::execute(), CAliM1543C_ide::get_status(), CAliM1543C_ide::ide_busmaster_read(), CAliM1543C_ide::ide_busmaster_write(), CAliM1543C_ide::ide_command_read(), CAliM1543C_ide::ide_command_write(), CAliM1543C_ide::ide_control_read(), CAliM1543C_ide::ide_control_write(), CAliM1543C_ide::ide_status(), CAliM1543C_ide::identify_drive(), CAliM1543C_ide::raise_interrupt(), CAliM1543C_ide::ResetPCI(), CAliM1543C_ide::run(), and CAliM1543C_ide::set_signature().
| #define DMRD fault |
Definition at line 381 of file AliM1543C_ide.h.
| #define IDE_BUFFER_SIZE 65536 |
Definition at line 288 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute(), CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define INCLUDED_ALIM1543C_IDE_H_ |
Definition at line 130 of file AliM1543C_ide.h.
| #define IR_CD 0x01 |
| #define IR_IO 0x02 |
| #define IR_REL 0x04 |
Definition at line 388 of file AliM1543C_ide.h.
| #define MAX_MULTIPLE_SECTORS 128 |
| #define PACKET_DI 4 |
| #define PACKET_DP0 0 |
Definition at line 400 of file AliM1543C_ide.h.
| #define PACKET_DP1 1 |
| #define PACKET_DP2 2 |
| #define PACKET_DP34 3 |
| #define PACKET_NONE 0 |
Definition at line 399 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute(), and CAliM1543C_ide::ide_command_write().
| #define PER_DRIVE | ( | a, | |||
| b | ) | state.controller[a].drive[b] |
| #define PRI_BUSMASTER 5 |
Definition at line 345 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define PRI_COMMAND 1 |
Definition at line 341 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define PRI_CONTROL 2 |
Definition at line 342 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define REASON sector_count |
Definition at line 385 of file AliM1543C_ide.h.
| #define REG_COMMAND_COMMAND 7 |
| #define REG_COMMAND_CYL_HI 5 |
Definition at line 362 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_CYL_LOW 4 |
Definition at line 361 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_DATA 0 |
Definition at line 356 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_DRIVE 6 |
Definition at line 363 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_ERROR 1 |
| #define REG_COMMAND_FEATURES 1 |
| #define REG_COMMAND_SECTOR_COUNT 2 |
Definition at line 359 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_SECTOR_NO 3 |
Definition at line 360 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().
| #define REG_COMMAND_STATUS 7 |
| #define REGISTERS | ( | a, | |||
| b | ) | state.controller[a].drive[b].registers |
Definition at line 325 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute(), CAliM1543C_ide::ide_command_write(), CAliM1543C_ide::ResetPCI(), and CAliM1543C_ide::set_signature().
| #define SEC_BUSMASTER 6 |
Definition at line 346 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define SEC_COMMAND 3 |
Definition at line 343 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define SEC_CONTROL 4 |
Definition at line 344 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::init(), CAliM1543C_ide::ReadMem_Legacy(), and CAliM1543C_ide::WriteMem_Legacy().
| #define SEL_COMMAND | ( | a | ) | state.controller[a].drive[state.controller[a].selected].command |
Command for selected drive on controller a.
Definition at line 305 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::command_aborted(), CAliM1543C_ide::execute(), CAliM1543C_ide::ide_command_read(), CAliM1543C_ide::ide_command_write(), CAliM1543C_ide::ide_status(), and CAliM1543C_ide::run().
| #define SEL_DISK | ( | a | ) | get_disk(a, state.controller[a].selected) |
Selected drive on controller a.
Definition at line 313 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute(), CAliM1543C_ide::get_status(), CAliM1543C_ide::ide_command_write(), and CAliM1543C_ide::identify_drive().
| #define SEL_PER_DRIVE | ( | a | ) | state.controller[a].drive[state.controller[a].selected] |
Per-drive data for selected drive on controller a.
Definition at line 316 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute(), and CAliM1543C_ide::identify_drive().
| #define SEL_REGISTERS | ( | a | ) | state.controller[a].drive[state.controller[a].selected].registers |
Registers for selected drive on controller a.
Definition at line 309 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::command_aborted(), CAliM1543C_ide::execute(), CAliM1543C_ide::ide_command_read(), CAliM1543C_ide::ide_control_read(), CAliM1543C_ide::ide_control_write(), and CAliM1543C_ide::ide_status().
| #define SEL_STATUS | ( | a | ) | state.controller[a].drive[state.controller[a].selected].status |
Status for selected drive on controller a.
Definition at line 301 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::command_aborted(), CAliM1543C_ide::execute(), CAliM1543C_ide::get_status(), CAliM1543C_ide::ide_command_read(), CAliM1543C_ide::ide_command_write(), CAliM1543C_ide::ide_control_read(), and CAliM1543C_ide::ide_status().
| #define SENSE_ABORT_COMMAND 0x0b |
Definition at line 416 of file AliM1543C_ide.h.
| #define SENSE_BLANK_CHECK 0x08 |
Definition at line 415 of file AliM1543C_ide.h.
| #define SENSE_DATA_PROTECT 0x07 |
Definition at line 414 of file AliM1543C_ide.h.
| #define SENSE_HARDWARE_ERROR 0x04 |
Definition at line 411 of file AliM1543C_ide.h.
| #define SENSE_ILLEGAL_REQUEST 0x05 |
Definition at line 412 of file AliM1543C_ide.h.
| #define SENSE_MEDIUM_ERROR 0x03 |
Definition at line 410 of file AliM1543C_ide.h.
| #define SENSE_MISCOMPARE 0x0e |
Definition at line 417 of file AliM1543C_ide.h.
| #define SENSE_NONE 0x00 |
Definition at line 407 of file AliM1543C_ide.h.
| #define SENSE_NOT_READY 0x02 |
Definition at line 409 of file AliM1543C_ide.h.
| #define SENSE_RECOVERED_ERROR 0x01 |
Definition at line 408 of file AliM1543C_ide.h.
| #define SENSE_UNIT_ATTENTION 0x06 |
Definition at line 413 of file AliM1543C_ide.h.
| #define SERV seek_complete |
Definition at line 382 of file AliM1543C_ide.h.
| #define STATUS | ( | a, | |||
| b | ) | state.controller[a].drive[b].status |
Definition at line 319 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_control_write(), and CAliM1543C_ide::ResetPCI().
| #define UPDATE_ALT_STATUS | ( | a | ) |
Value:
{ \
SCOPED_WRITE_LOCK(mtRegisters[a]); \
SEL_STATUS(a).alt_status=get_status(a); \
}
Definition at line 334 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::command_aborted(), CAliM1543C_ide::ide_command_read(), CAliM1543C_ide::ide_command_write(), CAliM1543C_ide::raise_interrupt(), and CAliM1543C_ide::run().
const char* packet_states[] [static] |
Initial value:
{
"DP0: Prepare A",
"DP1: Receive Packet",
"DP2: Prepare B",
"DP3/4: Ready INITRQ/Transfer Data",
"DIx: Device Interrupt ",
}
Definition at line 391 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::execute().
const char* register_names[] [static] |
Initial value:
{
"DATA",
"ERROR/FEATURES",
"SECTOR_COUNT/PKT REASON",
"SECTOR_NO",
"CYL_LOW/PKT BYTE LOW",
"CYL_HI/PKT BYTE HI",
"DRIVE",
"STATUS/COMMAND",
}
Definition at line 367 of file AliM1543C_ide.h.
Referenced by CAliM1543C_ide::ide_command_read(), and CAliM1543C_ide::ide_command_write().