[LITMUS^RT] Interrupt Context

Neil Patrao illusion.webs at ymail.com
Tue Jul 25 08:26:32 CEST 2017


Hi Björn,
>> This depends on whether you are running in kernel mode or in user mode. 
My program is running in the kernel mode.

This is the hardware: https://www.aim-online.com/products/hardware/mil-std-1553/ape1553-x.aspxIt has a board support package which includes the driver and a library to access the hardware.All calls are made using the library. To access the device (under /dev/) via the library, the applicationeither needs to run as root or the permissions to the device has to be changed.
Below is an excerpt from the BSP manual:

Also, the programming manual suggests to use 2 separate functions to read/write from hardware.1. In case of accessing from interrupt handler function
2. In case of accessing normally from the programThis is what got me thinking if the interrupt runs in the process context or not. Warm Regards,Neil Patrao 

    On Monday, 24 July 2017 3:58 PM, Björn Brandenburg <bbb at mpi-sws.org> wrote:
 

 
Hi Neil,

> On 24. Jul 2017, at 15:42, Neil Patrao <illusion.webs at ymail.com> wrote:
> 
> 
> (2) implies: A PCIe board produces interrupts. The driver API let's me setup the interrupt handler. To set up the interrupt handler, I pass the pointer to my function so that when the interrupt occurs, my function executes.

this sounds like a fairly involved driver. Is your process a regular Linux task? If yes, then your callback function most likely isn’t called directly by the interrupt. Rather, there needs to be some driver interface (e.g, a character device driver) that relays the information that an interrupt occurred from the kernel to userspace. 

Can you point us to a description of the device and its driver?

> 
> From what you said, I understand that my function does not run in the context of my RT process.

This depends on whether you are running in kernel mode or in user mode. 

> 
> In this case, is there a way to handle interrupts so that they run in RT mode? 

You can make ksoftirqd a LITMUS^RT real-time task. You can also force certain drivers to run as threads, which you can then also make into LITMUS^RT real-time tasks.

> 
> If not, does it mean that the interrupt handler function runs as a normal Linux process?

No. Interrupt handlers do not run as processes in mainline Linux. 


- Björn

PS: Please keep the discussion on the list.



_______________________________________________
litmus-dev mailing list
litmus-dev at lists.litmus-rt.org
https://lists.litmus-rt.org/listinfo/litmus-dev


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20170725/f3f5ef3f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 91505 bytes
Desc: not available
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20170725/f3f5ef3f/attachment-0001.png>


More information about the litmus-dev mailing list