[RFC] INTRNG support for FIQs

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Tue, 12 Sep 2023 03:42:44 UTC
Hi,

As part of the efforts for supporting Apple Silicon hardware, we need to 
be able to route FIQs to our root interrupt controller. The initial 
patch we had for this just added an `intr_pic_claim_fiq` that was 
specific to aarch64, and effectively mirrored intr_pic_claim_root() 
except recording the root filter/arg off separately. It also enforced 
that the device handling FIQs is the same that claimed root status.

The second iteration patch can again be found here: 
https://reviews.freebsd.org/D40161 -- there's a small set of unrelated 
changes specific to aarch64 that will get split out, but I'd like to 
solicit feedback on the larger INTRNG part of this.

This second version instead adds a uint32_t mask of types that can be 
handled by the root controller. It adds an additional KPI to break that 
out, and makes the existing `intr_pic_claim_root` call the new KPI with 
the one reserved (highest) bit that indicates a normal IRQ to preserve 
source-level compatibility to some extent. `intr_irq_handler` received 
identical treatment. The high bit was chosen for the reserved type 
global to all platforms so that platform-specific additions have a 
harder time getting it wrong -- they just start at the low bit and work 
their way up.

The main problem I think it causes is that `intr_irq_filter_t` is no 
longer compatible with `driver_filter_t` and they can't be used 
interchangeably anymore, but I don't really see a way to avoid that. I'm 
also not sure how much we care.

Any feedback would be appreciated; I'd really like to be able to push
Apple support further in-tree over the coming months.

Thanks,

Kyle Evans