Skip to content

Commit

Permalink
base: support specifying PCI bdf on irq creation
Browse files Browse the repository at this point in the history
Required by the seL4 kernel interface for MSI creation and by another upstream
kernel.

Issue genodelabs#5423
  • Loading branch information
alex-ab committed Jan 16, 2025
1 parent 4334619 commit 266dd0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions repos/base/include/irq_session/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ struct Genode::Irq_connection : Connection<Irq_session>, Irq_session_client
* Constructor
*
* \param label (virtual) interrupt number
* \param device_config_phys config-space physical address
* \param device_config_phys PCI config-space physical address
* \param type interrupt type (e.g., msi/msi-x)
* \param bdf PCI bdf of device
*/
Irq_connection(Env &env,
Label const &label,
addr_t device_config_phys,
Type type = Irq_session::TYPE_MSI)
Type type,
unsigned bdf = 0x10000 /* invalid */)
:
Connection<Irq_session>(env, label, Ram_quota { RAM_QUOTA },
Args("irq_number=", label, ", "
"device_config_phys=", Hex(device_config_phys), ", "
"bdf=", Hex(bdf), ", "
"irq_type=", unsigned(type))),
Irq_session_client(cap())
{ }
Expand Down
3 changes: 2 additions & 1 deletion repos/os/src/driver/platform/device_component.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ Genode::Irq_session_capability Device_component::irq(unsigned idx)
} else
error("MSI(-x) detected for device without pci-config!");

irq.irq.construct(_env, irq.number, pci_cfg_addr, irq.type);
irq.irq.construct(_env, irq.number, pci_cfg_addr, irq.type,
Pci::Bdf::rid(_pci_config->bdf));
} else
irq.irq.construct(_env, irq.number, irq.mode, irq.polarity);

Expand Down

0 comments on commit 266dd0b

Please sign in to comment.