gem5  v20.1.0.0
Classes | Macros | Typedefs | Enumerations
ide_disk.hh File Reference
#include "base/statistics.hh"
#include "dev/io_device.hh"
#include "dev/storage/disk_image.hh"
#include "dev/storage/ide_atareg.h"
#include "dev/storage/ide_ctrl.hh"
#include "dev/storage/ide_wdcreg.h"
#include "params/IdeDisk.hh"
#include "sim/eventq.hh"

Go to the source code of this file.

Classes

struct  PrdEntry
 
class  PrdTableEntry
 
struct  CommandReg
 
class  IdeDisk
 IDE Disk device model. More...
 

Macros

#define DMA_BACKOFF_PERIOD   200
 
#define MAX_DMA_SIZE   0x20000
 
#define MAX_SINGLE_DMA_SIZE   0x10000
 
#define MAX_MULTSECT   (128)
 
#define PRD_BASE_MASK   0xfffffffe
 
#define PRD_COUNT_MASK   0xfffe
 
#define PRD_EOT_MASK   0x8000
 
#define DATA_OFFSET   (0)
 
#define ERROR_OFFSET   (1)
 
#define FEATURES_OFFSET   (1)
 
#define NSECTOR_OFFSET   (2)
 
#define SECTOR_OFFSET   (3)
 
#define LCYL_OFFSET   (4)
 
#define HCYL_OFFSET   (5)
 
#define SELECT_OFFSET   (6)
 
#define DRIVE_OFFSET   (6)
 
#define STATUS_OFFSET   (7)
 
#define COMMAND_OFFSET   (7)
 
#define CONTROL_OFFSET   (2)
 
#define ALTSTAT_OFFSET   (2)
 
#define SELECT_DEV_BIT   0x10
 
#define CONTROL_RST_BIT   0x04
 
#define CONTROL_IEN_BIT   0x02
 
#define STATUS_BSY_BIT   0x80
 
#define STATUS_DRDY_BIT   0x40
 
#define STATUS_DRQ_BIT   0x08
 
#define STATUS_SEEK_BIT   0x10
 
#define STATUS_DF_BIT   0x20
 
#define DRIVE_LBA_BIT   0x40
 
#define DEV0   (0)
 
#define DEV1   (1)
 

Typedefs

typedef struct PrdEntry PrdEntry_t
 
typedef struct CommandReg CommandReg_t
 
typedef enum Events Events_t
 
typedef enum DevAction DevAction_t
 
typedef enum DevState DevState_t
 
typedef enum DmaState DmaState_t
 

Enumerations

enum  Events {
  None = 0, Transfer, ReadWait, WriteWait,
  PrdRead, DmaRead, DmaWrite
}
 
enum  DevAction {
  ACT_NONE = 0, ACT_CMD_WRITE, ACT_CMD_COMPLETE, ACT_CMD_ERROR,
  ACT_SELECT_WRITE, ACT_STAT_READ, ACT_DATA_READY, ACT_DATA_READ_BYTE,
  ACT_DATA_READ_SHORT, ACT_DATA_WRITE_BYTE, ACT_DATA_WRITE_SHORT, ACT_DMA_READY,
  ACT_DMA_DONE, ACT_SRST_SET, ACT_SRST_CLEAR
}
 
enum  DevState {
  Device_Idle_S = 0, Device_Idle_SI, Device_Idle_NS, Device_Srst,
  Command_Execution, Prepare_Data_In, Data_Ready_INTRQ_In, Transfer_Data_In,
  Prepare_Data_Out, Data_Ready_INTRQ_Out, Transfer_Data_Out, Prepare_Data_Dma,
  Transfer_Data_Dma, Device_Dma_Abort
}
 
enum  DmaState { Dma_Idle = 0, Dma_Start, Dma_Transfer }
 

Detailed Description

Device model for an IDE disk

Definition in file ide_disk.hh.

Macro Definition Documentation

◆ ALTSTAT_OFFSET

#define ALTSTAT_OFFSET   (2)

Definition at line 109 of file ide_disk.hh.

◆ COMMAND_OFFSET

#define COMMAND_OFFSET   (7)

Definition at line 106 of file ide_disk.hh.

◆ CONTROL_IEN_BIT

#define CONTROL_IEN_BIT   0x02

Definition at line 113 of file ide_disk.hh.

◆ CONTROL_OFFSET

#define CONTROL_OFFSET   (2)

Definition at line 108 of file ide_disk.hh.

◆ CONTROL_RST_BIT

#define CONTROL_RST_BIT   0x04

Definition at line 112 of file ide_disk.hh.

◆ DATA_OFFSET

#define DATA_OFFSET   (0)

Definition at line 96 of file ide_disk.hh.

◆ DEV0

#define DEV0   (0)

Definition at line 121 of file ide_disk.hh.

◆ DEV1

#define DEV1   (1)

Definition at line 122 of file ide_disk.hh.

◆ DMA_BACKOFF_PERIOD

#define DMA_BACKOFF_PERIOD   200

Definition at line 59 of file ide_disk.hh.

◆ DRIVE_LBA_BIT

#define DRIVE_LBA_BIT   0x40

Definition at line 119 of file ide_disk.hh.

◆ DRIVE_OFFSET

#define DRIVE_OFFSET   (6)

Definition at line 104 of file ide_disk.hh.

◆ ERROR_OFFSET

#define ERROR_OFFSET   (1)

Definition at line 97 of file ide_disk.hh.

◆ FEATURES_OFFSET

#define FEATURES_OFFSET   (1)

Definition at line 98 of file ide_disk.hh.

◆ HCYL_OFFSET

#define HCYL_OFFSET   (5)

Definition at line 102 of file ide_disk.hh.

◆ LCYL_OFFSET

#define LCYL_OFFSET   (4)

Definition at line 101 of file ide_disk.hh.

◆ MAX_DMA_SIZE

#define MAX_DMA_SIZE   0x20000

Definition at line 61 of file ide_disk.hh.

◆ MAX_MULTSECT

#define MAX_MULTSECT   (128)

Definition at line 63 of file ide_disk.hh.

◆ MAX_SINGLE_DMA_SIZE

#define MAX_SINGLE_DMA_SIZE   0x10000

Definition at line 62 of file ide_disk.hh.

◆ NSECTOR_OFFSET

#define NSECTOR_OFFSET   (2)

Definition at line 99 of file ide_disk.hh.

◆ PRD_BASE_MASK

#define PRD_BASE_MASK   0xfffffffe

Definition at line 65 of file ide_disk.hh.

◆ PRD_COUNT_MASK

#define PRD_COUNT_MASK   0xfffe

Definition at line 66 of file ide_disk.hh.

◆ PRD_EOT_MASK

#define PRD_EOT_MASK   0x8000

Definition at line 67 of file ide_disk.hh.

◆ SECTOR_OFFSET

#define SECTOR_OFFSET   (3)

Definition at line 100 of file ide_disk.hh.

◆ SELECT_DEV_BIT

#define SELECT_DEV_BIT   0x10

Definition at line 111 of file ide_disk.hh.

◆ SELECT_OFFSET

#define SELECT_OFFSET   (6)

Definition at line 103 of file ide_disk.hh.

◆ STATUS_BSY_BIT

#define STATUS_BSY_BIT   0x80

Definition at line 114 of file ide_disk.hh.

◆ STATUS_DF_BIT

#define STATUS_DF_BIT   0x20

Definition at line 118 of file ide_disk.hh.

◆ STATUS_DRDY_BIT

#define STATUS_DRDY_BIT   0x40

Definition at line 115 of file ide_disk.hh.

◆ STATUS_DRQ_BIT

#define STATUS_DRQ_BIT   0x08

Definition at line 116 of file ide_disk.hh.

◆ STATUS_OFFSET

#define STATUS_OFFSET   (7)

Definition at line 105 of file ide_disk.hh.

◆ STATUS_SEEK_BIT

#define STATUS_SEEK_BIT   0x10

Definition at line 117 of file ide_disk.hh.

Typedef Documentation

◆ CommandReg_t

typedef struct CommandReg CommandReg_t

◆ DevAction_t

typedef enum DevAction DevAction_t

◆ DevState_t

typedef enum DevState DevState_t

◆ DmaState_t

typedef enum DmaState DmaState_t

◆ Events_t

typedef enum Events Events_t

◆ PrdEntry_t

typedef struct PrdEntry PrdEntry_t

Enumeration Type Documentation

◆ DevAction

enum DevAction
Enumerator
ACT_NONE 
ACT_CMD_WRITE 
ACT_CMD_COMPLETE 
ACT_CMD_ERROR 
ACT_SELECT_WRITE 
ACT_STAT_READ 
ACT_DATA_READY 
ACT_DATA_READ_BYTE 
ACT_DATA_READ_SHORT 
ACT_DATA_WRITE_BYTE 
ACT_DATA_WRITE_SHORT 
ACT_DMA_READY 
ACT_DMA_DONE 
ACT_SRST_SET 
ACT_SRST_CLEAR 

Definition at line 148 of file ide_disk.hh.

◆ DevState

enum DevState
Enumerator
Device_Idle_S 
Device_Idle_SI 
Device_Idle_NS 
Device_Srst 
Command_Execution 
Prepare_Data_In 
Data_Ready_INTRQ_In 
Transfer_Data_In 
Prepare_Data_Out 
Data_Ready_INTRQ_Out 
Transfer_Data_Out 
Prepare_Data_Dma 
Transfer_Data_Dma 
Device_Dma_Abort 

Definition at line 166 of file ide_disk.hh.

◆ DmaState

enum DmaState
Enumerator
Dma_Idle 
Dma_Start 
Dma_Transfer 

Definition at line 194 of file ide_disk.hh.

◆ Events

enum Events
Enumerator
None 
Transfer 
ReadWait 
WriteWait 
PrdRead 
DmaRead 
DmaWrite 

Definition at line 138 of file ide_disk.hh.


Generated on Wed Sep 30 2020 14:02:19 for gem5 by doxygen 1.8.17