* EVL Interrupt @ 2022-05-16 11:10 Sebastian Blaesing 2022-05-16 15:09 ` Philippe Gerum 0 siblings, 1 reply; 2+ messages in thread From: Sebastian Blaesing @ 2022-05-16 11:10 UTC (permalink / raw) To: xenomai Hi all, what is the best and fastest way to pass critical hardware Irq signal to control a semaphore in user space application? Is it possible that kernel and user space share a semaphore? ---- Sebastian ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: EVL Interrupt 2022-05-16 11:10 EVL Interrupt Sebastian Blaesing @ 2022-05-16 15:09 ` Philippe Gerum 0 siblings, 0 replies; 2+ messages in thread From: Philippe Gerum @ 2022-05-16 15:09 UTC (permalink / raw) To: Sebastian Blaesing; +Cc: xenomai Sebastian Blaesing via Xenomai <xenomai@xenomai.org> writes: > Hi all, > > what is the best and fastest way to pass critical hardware Irq signal > to control a semaphore in user space application? > > Is it possible that kernel and user space share a semaphore? > You do this indirectly: in the kernel driver which implements the IRQ handler, you create an EVL sema4, and an oob_ioctl() or oob_read() handler which waits on it. The IRQ handler posts the sema4 which the user-space application pends on via a call to oob_{ioctl|read}(). The driver which talks to the 'latmus' application implements the same pattern, using an EVL flag instead of a sema4, but the logic is otherwise the same. Some handler triggered by some event (here a timer, yours would be triggered by an IRQ) raises a flag [1], which is awaited by a function [2] which is called by the application via the oob_ioctl() syscall [3]. HTH, [1] https://source.denx.de/Xenomai/xenomai4/linux-evl/-/blob/v5.15.y-evl-rebase/drivers/evl/latmus.c#L561 [2] https://source.denx.de/Xenomai/xenomai4/linux-evl/-/blob/v5.15.y-evl-rebase/drivers/evl/latmus.c#L627 [3] https://source.denx.de/Xenomai/xenomai4/linux-evl/-/blob/v5.15.y-evl-rebase/drivers/evl/latmus.c#L1130 -- Philippe. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-16 15:09 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-16 11:10 EVL Interrupt Sebastian Blaesing 2022-05-16 15:09 ` Philippe Gerum
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.