API to convert priorities to/from POSIX from/to Classic?

Joel Sherrill joel at rtems.org
Mon Jul 30 16:32:33 UTC 2018


On Mon, Jul 30, 2018 at 11:29 AM, Gedare Bloom <gedare at rtems.org> wrote:

> On Mon, Jul 30, 2018 at 11:23 AM, Joel Sherrill <joel at rtems.org> wrote:
> >
> >
> > On Mon, Jul 30, 2018 at 7:43 AM, Sebastian Huber
> > <sebastian.huber at embedded-brains.de> wrote:
> >>
> >> On 30/07/18 14:25, Joel Sherrill wrote:
> >>>
> >>>
> >>>
> >>> On Mon, Jul 30, 2018, 6:26 AM Sebastian Huber
> >>> <sebastian.huber at embedded-brains.de
> >>> <mailto:sebastian.huber at embedded-brains.de>> wrote:
> >>>
> >>>     Hello,
> >>>
> >>>     is there a standard API to convert priorities to/from POSIX from/to
> >>>     Classic? If not, I think we should add something.
> >>>
> >>>
> >>> There is not a public API for this.  There are some internal helpers
> >>
> >>
> >> Do you know the name of the helpers?
> >
> >
> > I was thinking of the _RTEMS_Priority_To_Core,
> > _RTEMS_Priority_From_core, and the similar
> > POSIX helper.
> >
> > These are probably useful to some users. No real
> > cost to applications that don't use them.
> >
>
> These convert between the core kernel notion of priority and the api.
> I see no problem to add some wrappers like
>
> rtems_posix_priority_to_core() and from_core(), and
> rtems_priority_to_core(), and from_core().
>
> A user then could convert between the two APIs themselves if they need,
> like
> rtems_priority_from_core( rtems_posix_priority_to_core(p) );
>
> I would not introduce any conversion between classic and posix
> priorities directly. It is violation of the API independence.
>

In general, I don't disagree. But we don't promote out the idea of
using the core services either. Providing to/from core just results
in users writing code which does two conversions because we
didn't want to do it for them.

I think this is honestly just an edge case where the APIs do
often touch in a system and it might be helpful.

--joel


>
> Gedare
>
> >>
> >>
> >>
> >> --
> >> Sebastian Huber, embedded brains GmbH
> >>
> >> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> >> Phone   : +49 89 189 47 41-16
> >> Fax     : +49 89 189 47 41-09
> >> E-Mail  : sebastian.huber at embedded-brains.de
> >> PGP     : Public key available on request.
> >>
> >> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> >>
> >
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180730/33ca5b28/attachment-0002.html>


More information about the devel mailing list