Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Apr 2015 17:07:14 -0400
From:      John Baldwin <john@baldwin.cx>
To:        freebsd-drivers@freebsd.org
Cc:        =?ISO-8859-1?Q?Mat=EDas?= Perret Cantoni <perretcantonim@gmail.com>
Subject:   Re: general question on interrupts handling
Message-ID:  <1512772.cb4krpaZ39@ralph.baldwin.cx>
In-Reply-To: <CADLKG02i3%2BO0ZMo1vpcLLGFVaDEgrqzKBNSfrdL3zLwE4UMjtg@mail.gmail.com>
References:  <CADLKG02i3%2BO0ZMo1vpcLLGFVaDEgrqzKBNSfrdL3zLwE4UMjtg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, March 12, 2015 06:52:25 PM Mat=EDas Perret Cantoni wrote:
> Hi!
>=20
> I'm writing my first interrupt handling routine of a newbus driver an=
d I'm
> not sure what things should I take care of in my ISR and what things =
the
> system will take care.
>=20
> I'm working on a Xilinx Zynq-7000 platform. I'm generating a Shared
> Peripheral Interrupt from the FPGA.
>=20
> For example...
> ... do I have to disable interrupts upon entering my ISR and enable t=
hem
> again before returning, o FreeBSD does it for me?
> ... do I have to clear the GIC interrupt status of my interrupt or th=
e
> systems does it automatically when my routine returns?
>=20
> Please excuse me if this is too general or silly.  If you can point m=
e any
> documentation or sources to read, It'd be great.

For a regular interrupt handler that runs in an thread context, the sys=
tem
will generally mask your device's interrupt until the interrupt thread =
is
scheduled and runs your handler.  After your handler returns the interr=
upt
will be unmasked.

For a filter interrupt handler that does not run in an interrupt thread=

context, no masking is done and you generally need to mask the interrup=
t
yourself using a device-specific register if you cannot fully handle th=
e
interrupt in the filter routine.

--=20
John Baldwin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1512772.cb4krpaZ39>