Invalid rtems_id?

Joel Sherrill joel.sherrill at OARcorp.com
Thu Mar 20 13:32:46 UTC 2008


Sebastian Huber wrote:
> Hi,
> is there a standard way to test if a rtems_id is valid? I want to do the
> following:
>
> if (rtems_id == INVALID) {
>     use default object
> } else {
>     use object associated with rtems_id
> }
>   

Interesting question. 

Not at the moment as a direct answer.  There is a new collection
of object services if you look at the CVS head and the nightly
built documentation.  The rtems_object_get_name() would
be one way although heavy handed.

If you want to define such as a service it sounds like a reasonable
addition to the Object Services methods.  The rtems_object_get_name()
code would be a good example.  It can take any id and has to know
if it is good or bad before grabbing the name.

Be warned that there is officially no value that is an invalid id.
0 is RTEMS_SELF which indicates the calling thread.  Technically
there are values which are always illegal (index portion == 0)
but we don't have an invalid id constant.

This might be something worth discussing also.
> Ciao
>     Sebastian
>
> --------------------------------------------
> embedded brains GmbH
> Sebastian Huber           Obere Lagerstr. 30
> D-82178 Puchheim          Germany
> Tel. : +49-89-18 90 80 79-6
> Fax  : +49-89-18 90 80 79-9
> email: Sebastian.Huber at embedded-brains.de
> PGP public key available on request
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list