AliM1543C_ide.h File Reference


Detailed Description

Contains the definitions for the emulated Ali M1543C IDE chipset part.

Id
AliM1543C_ide.h,v 1.22 2008/03/26 19:04:41 iamcamiel Exp

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_idetheIDE


Define Documentation

#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

Definition at line 384 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define CHK   err

Definition at line 383 of file AliM1543C_ide.h.

#define COMMAND ( a,
 )     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 (  )     state.controller[a]

#define DMRD   fault

Definition at line 381 of file AliM1543C_ide.h.

#define IDE_BUFFER_SIZE   65536

#define INCLUDED_ALIM1543C_IDE_H_

Definition at line 130 of file AliM1543C_ide.h.

#define IR_CD   0x01

Definition at line 386 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define IR_IO   0x02

Definition at line 387 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define IR_REL   0x04

Definition at line 388 of file AliM1543C_ide.h.

#define MAX_MULTIPLE_SECTORS   128

Definition at line 149 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::identify_drive().

#define PACKET_DI   4

Definition at line 404 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define PACKET_DP0   0

Definition at line 400 of file AliM1543C_ide.h.

#define PACKET_DP1   1

Definition at line 401 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define PACKET_DP2   2

Definition at line 402 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#define PACKET_DP34   3

Definition at line 403 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::execute().

#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,
 )     state.controller[a].drive[b]

Definition at line 328 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::ResetPCI().

#define PRI_BUSMASTER   5

#define PRI_COMMAND   1

#define PRI_CONTROL   2

#define REASON   sector_count

Definition at line 385 of file AliM1543C_ide.h.

#define REG_COMMAND_COMMAND   7

Definition at line 365 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::ide_command_write().

#define REG_COMMAND_CYL_HI   5

#define REG_COMMAND_CYL_LOW   4

#define REG_COMMAND_DATA   0

#define REG_COMMAND_DRIVE   6

#define REG_COMMAND_ERROR   1

Definition at line 357 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::ide_command_read().

#define REG_COMMAND_FEATURES   1

Definition at line 358 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::ide_command_write().

#define REG_COMMAND_SECTOR_COUNT   2

#define REG_COMMAND_SECTOR_NO   3

#define REG_COMMAND_STATUS   7

Definition at line 364 of file AliM1543C_ide.h.

Referenced by CAliM1543C_ide::ide_command_read().

#define REGISTERS ( a,
 )     state.controller[a].drive[b].registers

#define SEC_BUSMASTER   6

#define SEC_COMMAND   3

#define SEC_CONTROL   4

#define SEL_COMMAND (  )     state.controller[a].drive[state.controller[a].selected].command

#define SEL_DISK (  )     get_disk(a, state.controller[a].selected)

#define SEL_PER_DRIVE (  )     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 (  )     state.controller[a].drive[state.controller[a].selected].registers

#define SEL_STATUS (  )     state.controller[a].drive[state.controller[a].selected].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,
 )     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 (  ) 


Variable Documentation

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().

Definition at line 1415 of file AliM1543C_ide.cpp.

Referenced by CAliM1543C_ide::CAliM1543C_ide().


SourceForge.net Logo
Project space on SourceForge.net