Correct return values for _Objects_Get_class()?
ptorre at zetron.com
Tue Oct 23 14:40:49 CDT 2007
I have a question about the _Objects_Get_class() utility function.
(RTEMS 4.6.0, on powerpc 8xx, custom BSP)
This comes up during a call to pthread_getspecific(). If called in the
context of a classic API task, _Objects_Get_class() returns 1. If
called from a POSIX thread, it returns 2. These seem to be in conflict
with the definition of type Object_APIs, which maps classic to 2 and
POSIX to 3. Which one is correct, or is there a subtle "off by one"
that is supposed to be there?
The reason I noticed is that when pthread_key_create() is called, it
allocates an array of key values for each API, and the size of each
array is taken from the current "maximum" value for that API. When
those allocations are made, they look correct. If I have 50 classic
tasks configured, I get ((50+1)*4) bytes of workspace allocated and
pointed to by the_key->Values. It seems that pthread_key_create()
and pthread_getspecific() are in disagreement about the "class" part
of the object IDs.
Does anyone know why that is?
Phil Torre phone: 425-820-6363 x234
Design Engineer email: ptorre at zetron.com
Switching Systems Group fax: 425-820-7031
Zetron, Inc. web: http://www.zetron.com
More information about the rtems-users