k_poll usage


Vakul Garg <vakul.garg@...>
 

Hi

 

The zephyr documentation says k_poll to operate on objects – kernel fifo, poll signal, semaphore.

Can’t it also be used on mailboxes, message queues etc?

 

Regards

 

Vakul


Paul Sokolovsky
 

Hello Vakul,

On Fri, 13 Oct 2017 05:48:22 +0000
Vakul Garg <vakul.garg@nxp.com> wrote:

Hi

The zephyr documentation says k_poll to operate on objects - kernel
fifo, poll signal, semaphore. Can't it also be used on mailboxes,
message queues etc?
Looking at the include/kernel.h, all k_poll'able object must have
a .poll_events member (either directly or via _POLL_EVENT macro).
Mailboxes and message queues don't have it. This can be confirmed by
looking at kernel/poll.c:register_event(), which handles each of the
supported pollable objects via a switch statement.


Regards

Vakul


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Vakul Garg <vakul.garg@...>
 

Hi Paul

Thanks for the reply. It seems quite restrictive that most of zephyr IPC does not support k_poll. How applications can simultaneously poll on fifo, mailbox?

Any reason why kernel kept limited usage for k_poll?

Vakul


From: Paul Sokolovsky <paul.sokolovsky@...>
Sent: Tuesday, October 17, 2017 3:41:51 PM
To: Vakul Garg
Cc: zephyr-users@...
Subject: Re: [Zephyr-users] k_poll usage
 
Hello Vakul,

On Fri, 13 Oct 2017 05:48:22 +0000
Vakul Garg <vakul.garg@...> wrote:

> Hi
>
> The zephyr documentation says k_poll to operate on objects - kernel
> fifo, poll signal, semaphore. Can't it also be used on mailboxes,
> message queues etc?

Looking at the include/kernel.h, all k_poll'able object must have
a .poll_events member (either directly or via _POLL_EVENT macro).
Mailboxes and message queues don't have it. This can be confirmed by
looking at kernel/poll.c:register_event(), which handles each of the
supported pollable objects via a switch statement.

>
> Regards
>
> Vakul



--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Luiz Augusto von Dentz
 

Hi Vakul,

I had plans to introduce k_poll support for other objects but that
would probably make CONFIG_POLL mandatory, though we the changes
introduced for userspace I think we might have to delay this a little
bit to see how the APIs will gonna look like at the end.

On Tue, Oct 17, 2017 at 1:18 PM, Vakul Garg <vakul.garg@nxp.com> wrote:
Hi Paul

Thanks for the reply. It seems quite restrictive that most of zephyr IPC
does not support k_poll. How applications can simultaneously poll on fifo,
mailbox?

Any reason why kernel kept limited usage for k_poll?

Vakul

Get Outlook for Android

________________________________
From: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Sent: Tuesday, October 17, 2017 3:41:51 PM
To: Vakul Garg
Cc: zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] k_poll usage

Hello Vakul,

On Fri, 13 Oct 2017 05:48:22 +0000
Vakul Garg <vakul.garg@nxp.com> wrote:

Hi

The zephyr documentation says k_poll to operate on objects - kernel
fifo, poll signal, semaphore. Can't it also be used on mailboxes,
message queues etc?
Looking at the include/kernel.h, all k_poll'able object must have
a .poll_events member (either directly or via _POLL_EVENT macro).
Mailboxes and message queues don't have it. This can be confirmed by
looking at kernel/poll.c:register_event(), which handles each of the
supported pollable objects via a switch statement.


Regards

Vakul


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users
--
Luiz Augusto von Dentz