Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

D Programming/RTAI/User Space Interrupts

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

RTAI has user space interrupts called RTAI USI. Let Linux assign a IRQ number for you PCI device But before one can use them, the hardware interrupt has to be mapped to interrupt in Linux. Therefore it is necessary to build a kernel module for the pci device, that registers the interrupt. With this action, the device gets a new interrupt number, which can be used in the usi. Writing an interrupt handler Create a realtime thread: In the thread make a loop, looking like that: public void run(){ const int irqNum = 5; rt_request_irq_task( irqNum, null, RT_IRQ_TASK, 1 ); rt_startup_irq( irqNum ); rt_enable_irq( irqNum ); while( true ){ int overrun = rt_irq_wait( irqNum ); if( overrun == RT_IRQ_TASK_ERR ) break; // if program should quit, break here // Do the irq handling rt_ack_irq(); } rt_release_irq_task( irqNum ); }