Commit Graph
3 Commits
Author SHA1 Message Date
Alexandre Courbot 5d9c4c272b rust: irq: always inline functions using build_assert with arguments
`build_assert` relies on the compiler to optimize out its error path.
Functions using it with its arguments must thus always be inlined,
otherwise the error path of `build_assert` might not be optimized out,
triggering a build error.

Cc: [email protected]
Fixes: 746680ec66 ("rust: irq: add flags module")
Reviewed-by: Daniel Almeida <[email protected]>
Signed-off-by: Alexandre Courbot <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
2026-01-14 20:32:28 +01:00
Daniel Almeida 0851d34a8c rust: irq: add support for non-threaded IRQs and handlers
This patch adds support for non-threaded IRQs and handlers through
irq::Registration and the irq::Handler trait.

Registering an irq is dependent upon having a IrqRequest that was
previously allocated by a given device. This will be introduced in
subsequent patches.

Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Remove expect(dead_code) from Flags::into_inner(), add
  expect(dead_code) to IrqRequest::new(), fix intra-doc links. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
2025-08-12 20:22:00 +02:00
Daniel Almeida 746680ec66 rust: irq: add flags module
Manipulating IRQ flags (i.e.: IRQF_*) will soon be necessary, specially to
register IRQ handlers through bindings::request_irq().

Add a kernel::irq::Flags for that purpose.

Reviewed-by: Alice Ryhl <[email protected]>
Tested-by: Joel Fernandes <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Signed-off-by: Daniel Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Use expect(dead_code) for into_inner(), fix broken intra-doc link and
  typo. - Danilo ]
Signed-off-by: Danilo Krummrich <[email protected]>
2025-08-12 20:04:22 +02:00