mirror of
https://github.com/holub/mame
synced 2025-06-05 04:16:28 +03:00
pci.cpp: devices can ask to be mapped before the others (nw)
Will be used by the isa bridge in the southbridge.
This commit is contained in:
parent
0fae49dc31
commit
18c91a773f
@ -540,10 +540,18 @@ void pci_bridge_device::reset_all_mappings()
|
||||
void pci_bridge_device::map_device(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
|
||||
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
|
||||
{
|
||||
for(int i = int(all_devices.size())-1; i>=0; i--)
|
||||
const int count = int(all_devices.size()) - 1;
|
||||
|
||||
for(int i = count; i >= 0; i--)
|
||||
if (all_devices[i] != this)
|
||||
if (all_devices[i]->map_first())
|
||||
all_devices[i]->map_device(memory_window_start, memory_window_end, memory_offset, memory_space,
|
||||
io_window_start, io_window_end, io_offset, io_space);
|
||||
for(int i = count; i>=0; i--)
|
||||
if(all_devices[i] != this)
|
||||
all_devices[i]->map_device(memory_window_start, memory_window_end, memory_offset, memory_space,
|
||||
io_window_start, io_window_end, io_offset, io_space);
|
||||
if (!all_devices[i]->map_first())
|
||||
all_devices[i]->map_device(memory_window_start, memory_window_end, memory_offset, memory_space,
|
||||
io_window_start, io_window_end, io_offset, io_space);
|
||||
|
||||
map_extra(memory_window_start, memory_window_end, memory_offset, memory_space,
|
||||
io_window_start, io_window_end, io_offset, io_space);
|
||||
|
@ -41,6 +41,9 @@ public:
|
||||
virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
|
||||
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space);
|
||||
|
||||
// Specify if this device must be mapped before all the others on the pci bus
|
||||
virtual bool map_first() { return false; }
|
||||
|
||||
void map_config(uint8_t device, address_space *config_space);
|
||||
|
||||
virtual void config_map(address_map &map);
|
||||
|
Loading…
Reference in New Issue
Block a user