platform(x86): avoid multiple assignment messages

The new ported linux drivers multiple times trigger this assignment,
whereby exactly one time is sufficient.

Issue #4416
Issue #4450
Issue #4455
This commit is contained in:
Alexander Boettcher 2022-03-31 11:20:59 +02:00 committed by Christian Helmuth
parent 1dc92c49ed
commit 6994354b8f
2 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,8 @@ void Platform::Device_component::config_write(unsigned char address,
} }
/* assign device to device_pd */ /* assign device to device_pd */
if (address == Device_config::PCI_CMD_REG && if (!_device_assigned &&
address == Device_config::PCI_CMD_REG &&
(value & Device_config::PCI_CMD_DMA)) { (value & Device_config::PCI_CMD_DMA)) {
try { _session.assign_device(this); } try { _session.assign_device(this); }
@ -147,6 +148,7 @@ void Platform::Device_component::config_write(unsigned char address,
catch (...) { catch (...) {
error("assignment to device failed"); error("assignment to device failed");
} }
_device_assigned = true;
_device_used = true; _device_used = true;
} }

View File

@ -60,6 +60,7 @@ class Platform::Device_component : public Rpc_object<Platform::Device>,
Irq_session_component *_irq_session = nullptr; Irq_session_component *_irq_session = nullptr;
unsigned short _irq_line; unsigned short _irq_line;
bool _device_used { false }; bool _device_used { false };
bool _device_assigned { false };
Allocator &_global_heap; Allocator &_global_heap;
class Io_mem : public Io_mem_connection, class Io_mem : public Io_mem_connection,