[RFC] Refactored interrupt handling on ARM

Warner Losh imp at bsdimp.com
Tue Apr 15 20:03:19 UTC 2014


On Apr 15, 2014, at 11:36 AM, Jakub Klama <jakub.klama at uj.edu.pl> wrote:

> On Tue, 15 Apr 2014 10:41:42 -0600, Ian Lepore wrote:
>> IMO we do too much of this.  Unless there's a really good reason not to
>> update the older platforms to use this new scheme, I think we should
>> just convert everything to the new way.
> 
> I'd also vote for that.
> 
>> Since this is only needed by the new arm code, and the new arm code only
>> calls intr_event_handle() from arm_dispatch_irq(), can't this logic just
>> move into there?
> 
> Good point. I think that following change should be sufficent:
> 
> --- a/sys/arm/arm/intrng.c
> +++ b/sys/arm/arm/intrng.c
> @@ -113,6 +113,14 @@ arm_dispatch_irq(device_t dev, struct trapframe *tf, int irq)
>        debugf("pic %s, tf %p, irq %d\n", device_get_nameunit(dev), tf, irq);
> +       /*
> +        * If we got null trapframe argument, that probably means
> +        * a call from non-root interrupt controller. In that case,
> +        * we'll just use the saved one.
> +        */
> +       if (tf == NULL)
> +               tf = PCPU_GET(curthread)->td_intr_frame;
> +
>        for (i = 0; arm_intrs[i].ih_dev != NULL; i++) {
>                if (arm_intrs[i].ih_pic->ic_dev == dev &&
>                    arm_intrs[i].ih_irq == irq) {

I’d have thought that the cascading controllers would have passed this trap frame
along. What am I missing?

Warner


More information about the freebsd-arm mailing list