Date: Tue, 15 Apr 2014 19:36:24 +0200 From: Jakub Klama <jakub.klama@uj.edu.pl> To: Ian Lepore <ian@FreeBSD.org> Cc: freebsd-arm@FreeBSD.org Subject: Re: [RFC] Refactored interrupt handling on ARM Message-ID: <da94dcc391d9f02709186d662eab696e@uj.edu.pl> In-Reply-To: <1397580102.1124.121.camel@revolution.hippie.lan> References: <3e7f866f4bc774975ae3c85e0df78ec2@uj.edu.pl> <53418D13.7030107@freebsd.org> <534C0F48.2090302@freebsd.org> <f2bebfa812ecb70f423b6be4779b217b@uj.edu.pl> <534C5A6A.1090707@freebsd.org> <246c2ef842c2b47eb2400c1f700ad441@uj.edu.pl> <534CC733.7010009@freebsd.org> <ACD52C94-A44A-42FD-8016-61B0B21B12D9@bsdimp.com> <619da7d72d2345b1fcac5426b45c6ead@uj.edu.pl> <1397580102.1124.121.camel@revolution.hippie.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
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) { Jakub
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?da94dcc391d9f02709186d662eab696e>