diff options
author | Andrew Schultz <alschult@umich.edu> | 2004-05-12 16:55:49 -0400 |
---|---|---|
committer | Andrew Schultz <alschult@umich.edu> | 2004-05-12 16:55:49 -0400 |
commit | ab9415a2bd608246501b33f5670d2a3ecc746dde (patch) | |
tree | 5934840c601813776fd0e1f9c34cdcda57b9fb97 /dev/ide_disk.hh | |
parent | c5ec5bf3a746ae5ccbd80e5959807cf35e1d4b93 (diff) | |
download | gem5-ab9415a2bd608246501b33f5670d2a3ecc746dde.tar.xz |
Fixes to DMA writing (still unverified) and added serialize/unserialize
dev/ide_ctrl.cc:
Added serialize/unserialize functions and move some inlined functions
to regular functions
dev/ide_ctrl.hh:
Change inlined functions to regular functions
dev/ide_disk.cc:
Changes to dmaWrite and also add serialize/unserialize functions
dev/ide_disk.hh:
Support for serializing/unserializing
--HG--
extra : convert_revision : 40e016dc7f6637b033fe33409338437c985a05f4
Diffstat (limited to 'dev/ide_disk.hh')
-rw-r--r-- | dev/ide_disk.hh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/dev/ide_disk.hh b/dev/ide_disk.hh index 88a492cbc..35e7404d5 100644 --- a/dev/ide_disk.hh +++ b/dev/ide_disk.hh @@ -94,7 +94,7 @@ class PrdTableEntry { #define STATUS_BSY_BIT 0x80 #define STATUS_DRDY_BIT 0x40 #define STATUS_DRQ_BIT 0x08 -#define DRIVE_LBA_BIT 0x40 +#define DRIVE_LBA_BIT 0x40 #define DEV0 (0) #define DEV1 (1) @@ -120,6 +120,16 @@ typedef struct CommandReg { }; } CommandReg_t; +typedef enum Events { + None = 0, + Transfer, + ReadWait, + WriteWait, + PrdRead, + DmaRead, + DmaWrite +} Events_t; + typedef enum DevAction { ACT_NONE = 0, ACT_CMD_WRITE, @@ -184,7 +194,7 @@ class IdeDisk : public SimObject PhysicalMemory *physmem; protected: - /** The disk delay in milliseconds. */ + /** The disk delay in microseconds. */ int diskDelay; private: @@ -214,6 +224,8 @@ class IdeDisk : public SimObject uint32_t curPrdAddr; /** PRD entry */ PrdTableEntry curPrd; + /** Number of bytes transfered by DMA interface for current transfer */ + uint32_t dmaInterfaceBytes; /** Device ID (master=0/slave=1) */ int devID; /** Interrupt pending */ @@ -313,7 +325,9 @@ class IdeDisk : public SimObject (cmdReg.cyl_low << 8) | (cmdReg.sec_num)); } - inline Addr pciToDma(Addr &pciAddr); + inline Addr pciToDma(Addr pciAddr); + + uint32_t bytesInDmaPage(Addr curAddr, uint32_t bytesLeft); /** * Serialize this object to the given output stream. |