summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/pci-ide.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-25 22:28:49 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-25 22:28:49 +1000
commit106e27478414a80e0959be52e55b23742855646c (patch)
treebaff6778e3449f8f9f7fb33a6935eaeb0bc5f255 /src/devices/machine/pci-ide.h
parentfada3dfc8b58b1209c6dcd4cf7837b4d23c88d82 (diff)
remove many mainly PCI-related MCFG macros in favour of constructor
overloads, remove some absolute device lookups, remove some absolute device tags, and generally clean up stuff fix incorrect device class for PCI APIC (nw) xbox machine config looks ugly now - the devices should expose proper constructor overloads that accept the parts of the PCI ID that are in system PROM or customisable by the OEM and hard-code the parts inherent to the device
Diffstat (limited to 'src/devices/machine/pci-ide.h')
-rw-r--r--src/devices/machine/pci-ide.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h
index 95f43ea8e15..c6bafacc8df 100644
--- a/src/devices/machine/pci-ide.h
+++ b/src/devices/machine/pci-ide.h
@@ -19,29 +19,26 @@ TODO:
#include "pci.h"
#include "idectrl.h"
-#define MCFG_IDE_PCI_ADD(_tag, _main_id, _revision, _subdevice_id) \
- MCFG_PCI_DEVICE_ADD(_tag, IDE_PCI, _main_id, _revision, 0x01018a, _subdevice_id)
-
-// Setting this to a value other than -1 will cause the ide_pci_device to assert/clear the cpu interrupt directly.
-#define MCFG_IDE_PCI_IRQ_ADD(_cpu_tag, _irq_num) \
- downcast<ide_pci_device *>(device)->set_irq_info(_cpu_tag, _irq_num);
-
#define MCFG_IDE_PCI_IRQ_HANDLER(_devcb) \
devcb = &downcast<ide_pci_device &>(*device).set_irq_handler(DEVCB_##_devcb);
// This will set the top 12 bits for address decoding in legacy mode. Needed for seattle driver.
#define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \
- downcast<ide_pci_device *>(device)->set_legacy_top(_val);
+ downcast<ide_pci_device &>(*device).set_legacy_top(_val);
// Sets the default Programming Interface (PIF) register
#define MCFG_IDE_PCI_SET_PIF(_val) \
- downcast<ide_pci_device *>(device)->set_pif(_val);
+ downcast<ide_pci_device &>(*device).set_pif(_val);
class ide_pci_device : public pci_device {
public:
+ ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t main_id, uint32_t revision, uint32_t subdevice_id)
+ : ide_pci_device(mconfig, tag, owner, clock)
+ {
+ set_ids(main_id, revision, 0x01018a, subdevice_id);
+ }
ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_irq_info(const char *tag, const int irq_num);
template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
void set_legacy_top(int val) { m_legacy_top = val & 0xfff; };
void set_pif(int val) { m_pif = val & 0xff; };
@@ -71,9 +68,6 @@ private:
required_device<bus_master_ide_controller_device> m_ide;
required_device<bus_master_ide_controller_device> m_ide2;
- const char *m_cpu_tag;
- cpu_device *m_cpu;
- int m_irq_num;
devcb_write_line m_irq_handler;
uint32_t pci_bar[6];
// Bits 31-20 for legacy mode hack