Previous 199869 Revisions Next

r33321 Monday 10th November, 2014 at 18:46:18 UTC by Olivier Galibert
pci: Add remapping notifiers [O. Galibert]
[src/emu/machine]i6300esb.c pci.c pci.h

trunk/src/emu/machine/i6300esb.c
r241832r241833
7171   lpc_if_sound_range = 0x00;
7272   fwh_dec_en1 = 0xff;
7373   gen1_dec = 0x0000;
74   lpc_en = 0x2000;
74   lpc_en = 0x0000;
7575   fwh_sel1 = 0x00112233;
7676}
7777
r241832r241833
8585   COMBINE_DATA(&gpio_base);
8686   gpio_base &= 0x0000ffc0;
8787   logerror("%s: gpio_base = %08x\n", tag(), gpio_base);
88   remap_cb();
8889}
8990
9091READ8_MEMBER  (i6300esb_lpc_device::gpio_cntl_r)
r241832r241833
9697{
9798   COMBINE_DATA(&gpio_cntl);
9899   logerror("%s: gpio_cntl = %02x\n", tag(), gpio_cntl);
100   remap_cb();
99101}
100102
101103READ8_MEMBER  (i6300esb_lpc_device::lpc_if_com_range_r)
r241832r241833
107109{
108110   COMBINE_DATA(&lpc_if_com_range);
109111   logerror("%s: lpc_if_com_range  = %02x\n", tag(), lpc_if_com_range);
112   remap_cb();
110113}
111114
112115READ8_MEMBER  (i6300esb_lpc_device::lpc_if_fdd_lpt_range_r)
r241832r241833
118121{
119122   COMBINE_DATA(&lpc_if_fdd_lpt_range);
120123   logerror("%s: lpc_if_fdd_lpt_range  = %02x\n", tag(), lpc_if_fdd_lpt_range);
124   remap_cb();
121125}
122126
123127READ8_MEMBER  (i6300esb_lpc_device::lpc_if_sound_range_r)
r241832r241833
129133{
130134   COMBINE_DATA(&lpc_if_sound_range);
131135   logerror("%s: lpc_if_sound_range  = %02x\n", tag(), lpc_if_sound_range);
136   remap_cb();
132137}
133138
134139READ8_MEMBER  (i6300esb_lpc_device::fwh_dec_en1_r)
r241832r241833
140145{
141146   fwh_dec_en1 = data | 0x80;
142147   logerror("%s: fwh_dec_en1  = %02x\n", tag(), fwh_dec_en1);
148   remap_cb();
143149}
144150
145151READ16_MEMBER (i6300esb_lpc_device::gen1_dec_r)
r241832r241833
151157{
152158   COMBINE_DATA(&gen1_dec);
153159   logerror("%s: gen1_dec = %04x\n", tag(), gen1_dec);
160   remap_cb();
154161}
155162
156163READ16_MEMBER (i6300esb_lpc_device::lpc_en_r)
r241832r241833
162169{
163170   COMBINE_DATA(&lpc_en);
164171   logerror("%s: lpc_en = %04x\n", tag(), lpc_en);
172   remap_cb();
165173}
166174
167175READ32_MEMBER (i6300esb_lpc_device::fwh_sel1_r)
r241832r241833
173181{
174182   COMBINE_DATA(&fwh_sel1);
175183   logerror("%s: fwh_sel1 = %08x\n", tag(), fwh_sel1);
184   remap_cb();
176185}
177186
178187READ32_MEMBER (i6300esb_lpc_device::unk_fc_r)
trunk/src/emu/machine/pci.c
r241832r241833
9191{
9292}
9393
94void pci_device::set_remap_cb(mapper_cb _remap_cb)
95{
96   remap_cb = _remap_cb;
97}
98
9499void pci_device::reset_all_mappings()
95100{
96101}
r241832r241833
163168   return this;
164169}
165170
171void pci_bridge_device::set_remap_cb(mapper_cb _remap_cb)
172{
173   remap_cb = _remap_cb;
174   for(int i=0; i != all_devices.count(); i++)
175      if(all_devices[i] != this)
176         all_devices[i]->set_remap_cb(_remap_cb);
177}
178
166179void pci_bridge_device::device_start()
167180{
168181   pci_device::device_start();
r241832r241833
179192      int fct = t[l-1] - '0';
180193      sub_devices[(id << 3) | fct] = downcast<pci_device *>(d);
181194   }
195
196   mapper_cb cf_cb(FUNC(pci_bridge_device::regenerate_config_mapping), this);
197
182198   for(int i=0; i<32*8; i++)
183199      if(sub_devices[i]) {
184200         all_devices.append(sub_devices[i]);
185201         if(sub_devices[i] != this) {
202            sub_devices[i]->remap_config_cb = cf_cb;
203            sub_devices[i]->set_remap_cb(remap_cb);
186204            pci_bridge_device *bridge = dynamic_cast<pci_bridge_device *>(sub_devices[i]);
187205            if(bridge)
188206               all_bridges.append(bridge);
r241832r241833
262280
263281void pci_host_device::device_start()
264282{
283   remap_cb = mapper_cb(FUNC(pci_host_device::regenerate_mapping), this);
284
265285   pci_bridge_device::device_start();
266286
267287   memory_window_start = memory_window_end = memory_offset = 0;
268288   io_window_start = io_window_end = io_offset = 0;
289
290   for(int i=0; i != all_devices.count(); i++)
291      if(all_devices[i] != this)
292         all_devices[i]->reset_all_mappings();
269293}
270294
271295void pci_host_device::device_reset()
trunk/src/emu/machine/pci.h
r241832r241833
2424
2525class pci_device : public device_t {
2626public:
27   typedef delegate<void ()> mapper_cb;
28
29   mapper_cb remap_cb, remap_config_cb;
30
2731   pci_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
2832
2933   void set_ids(UINT32 main_id, UINT8 revision, UINT32 pclass, UINT32 subsystem_id);
3034
35   virtual void set_remap_cb(mapper_cb _remap_cb);
3136   virtual void reset_all_mappings();
3237   virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
3338                     UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space);
r241832r241833
8792   pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8893   pci_bridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
8994
95   virtual void set_remap_cb(mapper_cb _remap_cb);
9096   virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
9197                     UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space);
9298   virtual void reset_all_mappings();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team