hw: Add MSI variables to Irq_session_component

Extend the base-hw Irq_session_component class with _is_msi, _address
and _value variables required to support MSI mode of operation.

Return MSI configuration in info() function if _is_msi is set to true.
This commit is contained in:
Reto Buerki 2016-02-16 16:41:08 +01:00 committed by Christian Helmuth
parent f1d2d7251d
commit 11ee72eaa6
2 changed files with 14 additions and 3 deletions

View File

@ -31,6 +31,8 @@ class Genode::Irq_session_component : public Rpc_object<Irq_session>,
unsigned _irq_number;
Range_allocator *_irq_alloc;
Genode::uint8_t _kernel_object[sizeof(Kernel::User_irq)];
bool _is_msi;
addr_t _address, _value;
Signal_context_capability _sig_cap;
@ -58,8 +60,16 @@ class Genode::Irq_session_component : public Rpc_object<Irq_session>,
void ack_irq() override;
void sigh(Signal_context_capability) override;
Info info() override {
return { .type = Genode::Irq_session::Info::Type::INVALID }; }
Info info() override
{
if (!_is_msi) {
return { .type = Info::Type::INVALID };
}
return { .type = Info::Type::MSI,
.address = _address,
.value = _value };
}
};
#endif /* _INCLUDE__IRQ_SESSION_COMPONENT_H_ */

View File

@ -66,7 +66,8 @@ Irq_session_component::~Irq_session_component()
Irq_session_component::Irq_session_component(Range_allocator * const irq_alloc,
const char * const args)
:
_irq_number(Platform::irq(_find_irq_number(args))), _irq_alloc(irq_alloc)
_irq_number(Platform::irq(_find_irq_number(args))), _irq_alloc(irq_alloc),
_is_msi(false), _address(0), _value(0)
{
long const msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
if (msi)