From f25070d441c3e2d8e5370e4a9e88dca7cff83466 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Fri, 9 Sep 2022 14:41:24 +0200 Subject: [PATCH] irq_connection: add constructor with session label When creating an Irq connection to a component (not core), e.g. a pin driver, we typically need a to provide a session label in order to apply a session policy and to distinguish multiple sessions from the same component. genodelabs/genode#4606 --- repos/base/include/irq_session/connection.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/repos/base/include/irq_session/connection.h b/repos/base/include/irq_session/connection.h index 38cb643640..f4b8f85ced 100644 --- a/repos/base/include/irq_session/connection.h +++ b/repos/base/include/irq_session/connection.h @@ -42,6 +42,26 @@ struct Genode::Irq_connection : Connection, Irq_session_client irq, trigger, polarity, device_config_phys)), Irq_session_client(cap()) { } + + /** + * Constructor for label-based configuration (used by pin driver) + * + * \param label session label + */ + Irq_connection(Env &env, + char const *label) + : + Connection(env, session(env.parent(), + "ram_quota=%u, cap_quota=%u, " + "irq_number=%u, irq_trigger=%u, " + "irq_polarity=%u, device_config_phys=0x%lx, " + "label=\"%s\"", + RAM_QUOTA, CAP_QUOTA, 0, + Irq_session::TRIGGER_UNCHANGED, + Irq_session::POLARITY_UNCHANGED, + 0, label)), + Irq_session_client(cap()) + { } }; #endif /* _INCLUDE__IRQ_SESSION__CONNECTION_H_ */