diff options
author | Nathan Binkert <binkertn@umich.edu> | 2004-11-13 15:45:22 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2004-11-13 15:45:22 -0500 |
commit | b031888038a905e1572bbd3ed42ee4e4a7f599a6 (patch) | |
tree | 10cdccb5372ed7618edbcf275988f60528478e37 /dev/ide_ctrl.hh | |
parent | e9f3279334f714de7bbd1415377715cd00a763d5 (diff) | |
download | gem5-b031888038a905e1572bbd3ed42ee4e4a7f599a6.tar.xz |
Use parameter structs for initialization so it's easier
to add new devices. Abstract the Platform more so that
it is unnecessary to know know platform specifics for
interrupting or translating PCI DMA addresses.
dev/ide_ctrl.cc:
convert to parameter struct for initialization
use the interrupt functions in the PciDev base class
convert from tsunami to using platform
We don't need an interrupt controller here.
dev/ide_ctrl.hh:
don't use Tsunami, use Platform
make the IdeDisk a friend so that it can access my plaform
convert to parameter struct for construction
dev/ide_disk.cc:
don't use tsunami references, but platform references
dev/ns_gige.cc:
Convert to parameter struct for initialzation. Use code in
base class for interrupts so we don't need to know anything
about the platform. Don't need an IntrControl *.
dev/ns_gige.hh:
We don't need a Tsunami * anymore
convert to a parameter struct for construction
dev/pcidev.cc:
deal with new parameter struct
dev/pcidev.hh:
- Move all of the configuration parameters into a param struct
that we can pass into the constructor.
- Add a Platform * for accessing new generic interrupt post/clear
and dma address translation fuctions
- Create functions for posting/clearing interrupts and translating
dma addresses
dev/platform.cc:
have default functions that panic on pci calls
dev/platform.hh:
don't make the pci stuff pure virtual, but rather provide
default implementations that panic. Also, add dma address
translation.
dev/tsunami.cc:
this-> isn't necessary here.
add pci address translation
dev/tsunami.hh:
implement the pciToDma address translation
--HG--
extra : convert_revision : 7db27a2fa1f1bd84704921ec7ca0280b5653c43e
Diffstat (limited to 'dev/ide_ctrl.hh')
-rw-r--r-- | dev/ide_ctrl.hh | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/dev/ide_ctrl.hh b/dev/ide_ctrl.hh index b29e5ae9a..9a6b476b8 100644 --- a/dev/ide_ctrl.hh +++ b/dev/ide_ctrl.hh @@ -80,14 +80,14 @@ typedef enum RegType { BMI_BLOCK } RegType_t; +class BaseInterface; +class Bus; +class HierParams; class IdeDisk; class IntrControl; class PciConfigAll; -class Tsunami; class PhysicalMemory; -class BaseInterface; -class HierParams; -class Bus; +class Platform; /** * Device model for an Intel PIIX4 IDE controller @@ -95,6 +95,8 @@ class Bus; class IdeController : public PciDev { + friend class IdeDisk; + private: /** Primary command block registers */ Addr pri_cmd_addr; @@ -125,10 +127,6 @@ class IdeController : public PciDev bool bm_enabled; bool cmd_in_progress[4]; - public: - /** Pointer to the chipset */ - Tsunami *tsunami; - private: /** IDE disks connected to controller */ IdeDisk *disks[4]; @@ -149,29 +147,18 @@ class IdeController : public PciDev bool isDiskSelected(IdeDisk *diskPtr); public: - /** - * Constructs and initializes this controller. - * @param name The name of this controller. - * @param ic The interrupt controller. - * @param mmu The memory controller - * @param cf PCI config space - * @param cd PCI config data - * @param bus_num The PCI bus number - * @param dev_num The PCI device number - * @param func_num The PCI function number - * @param host_bus The host bus to connect to - * @param hier The hierarchy parameters - */ - IdeController(const std::string &name, IntrControl *ic, - const std::vector<IdeDisk *> &new_disks, - MemoryController *mmu, PciConfigAll *cf, - PciConfigData *cd, Tsunami *t, - uint32_t bus_num, uint32_t dev_num, uint32_t func_num, - Bus *host_bus, Tick pio_latency, HierParams *hier); + struct Params : public PciDev::Params + { + /** Array of disk objects */ + std::vector<IdeDisk *> disks; + Bus *host_bus; + Tick pio_latency; + HierParams *hier; + }; + const Params *params() const { return (const Params *)_params; } - /** - * Deletes the connected devices. - */ + public: + IdeController(Params *p); ~IdeController(); virtual void WriteConfig(int offset, int size, uint32_t data); |