forked from Imagelibrary/rtems
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/keygetspecific.c, posix/src/keysetspecific.c, posix/src/semtimedwait.c: Correct indexing of key data to use api and index NOT class and index. Class is always 1.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2006-11-17 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* posix/src/keygetspecific.c, posix/src/keysetspecific.c,
|
||||||
|
posix/src/semtimedwait.c: Correct indexing of key data to use api and
|
||||||
|
index NOT class and index. Class is always 1.
|
||||||
|
|
||||||
2006-11-17 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2006-11-17 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* configure.ac: Suppress itron if int8/int16_t are not provided.
|
* configure.ac: Suppress itron if int8/int16_t are not provided.
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ void *pthread_getspecific(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
register POSIX_Keys_Control *the_key;
|
register POSIX_Keys_Control *the_key;
|
||||||
|
uint32_t api;
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
uint32_t class;
|
|
||||||
Objects_Locations location;
|
Objects_Locations location;
|
||||||
void *key_data;
|
void *key_data;
|
||||||
|
|
||||||
@@ -37,9 +37,9 @@ void *pthread_getspecific(
|
|||||||
case OBJECTS_REMOTE: /* should never happen */
|
case OBJECTS_REMOTE: /* should never happen */
|
||||||
return NULL;
|
return NULL;
|
||||||
case OBJECTS_LOCAL:
|
case OBJECTS_LOCAL:
|
||||||
|
api = _Objects_Get_API( _Thread_Executing->Object.id );
|
||||||
index = _Objects_Get_index( _Thread_Executing->Object.id );
|
index = _Objects_Get_index( _Thread_Executing->Object.id );
|
||||||
class = _Objects_Get_class( _Thread_Executing->Object.id );
|
key_data = (void *) the_key->Values[ api ][ index ];
|
||||||
key_data = (void *) the_key->Values[ class ][ index ];
|
|
||||||
_Thread_Enable_dispatch();
|
_Thread_Enable_dispatch();
|
||||||
return key_data;
|
return key_data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ int pthread_setspecific(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
register POSIX_Keys_Control *the_key;
|
register POSIX_Keys_Control *the_key;
|
||||||
|
uint32_t api;
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
uint32_t class;
|
|
||||||
Objects_Locations location;
|
Objects_Locations location;
|
||||||
|
|
||||||
the_key = _POSIX_Keys_Get( key, &location );
|
the_key = _POSIX_Keys_Get( key, &location );
|
||||||
@@ -37,9 +37,9 @@ int pthread_setspecific(
|
|||||||
case OBJECTS_REMOTE: /* should never happen */
|
case OBJECTS_REMOTE: /* should never happen */
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
case OBJECTS_LOCAL:
|
case OBJECTS_LOCAL:
|
||||||
|
api = _Objects_Get_API( _Thread_Executing->Object.id );
|
||||||
index = _Objects_Get_index( _Thread_Executing->Object.id );
|
index = _Objects_Get_index( _Thread_Executing->Object.id );
|
||||||
class = _Objects_Get_class( _Thread_Executing->Object.id );
|
the_key->Values[ api ][ index ] = (void *) value;
|
||||||
the_key->Values[ class ][ index ] = (void *) value;
|
|
||||||
_Thread_Enable_dispatch();
|
_Thread_Enable_dispatch();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,18 +48,18 @@ int sem_timedwait(
|
|||||||
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
|
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
|
if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
|
||||||
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
|
blocking = CORE_SEMAPHORE_BAD_TIMEOUT;
|
||||||
else {
|
} else {
|
||||||
(void) clock_gettime( CLOCK_REALTIME, ¤t_time );
|
clock_gettime( CLOCK_REALTIME, ¤t_time );
|
||||||
/*
|
/*
|
||||||
* Make sure the abstime is in the future
|
* Make sure the abstime is in the future
|
||||||
*/
|
*/
|
||||||
if ( abstime->tv_sec < current_time.tv_sec )
|
if ( abstime->tv_sec < current_time.tv_sec )
|
||||||
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
|
blocking = CORE_SEMAPHORE_BAD_TIMEOUT;
|
||||||
else if ( (abstime->tv_sec == current_time.tv_sec) &&
|
else if ( (abstime->tv_sec == current_time.tv_sec) &&
|
||||||
(abstime->tv_nsec <= current_time.tv_nsec) )
|
(abstime->tv_nsec <= current_time.tv_nsec) )
|
||||||
blocking = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE;
|
blocking = CORE_SEMAPHORE_BAD_TIMEOUT;
|
||||||
else {
|
else {
|
||||||
_POSIX_Timespec_subtract( ¤t_time, abstime, &difference );
|
_POSIX_Timespec_subtract( ¤t_time, abstime, &difference );
|
||||||
ticks = _POSIX_Timespec_to_interval( &difference );
|
ticks = _POSIX_Timespec_to_interval( &difference );
|
||||||
|
|||||||
Reference in New Issue
Block a user