diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-06 19:38:19 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-06 19:38:19 +0000 |
commit | 76deaf0c64fd8598bb35a4ab8a1774dc3c2bb6ee (patch) | |
tree | a1304471ad816b4a7f65f28cf1c33fce1d05b7ee | |
parent | Spacing. (diff) | |
download | rtems-76deaf0c64fd8598bb35a4ab8a1774dc3c2bb6ee.tar.bz2 |
2008-05-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* rtems/include/rtems/rtems/message.h, sapi/include/confdefs.h,
score/src/coresemseize.c, score/src/threadhandler.c: Comment
improvements from class.
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/message.h | 2 | ||||
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 7 | ||||
-rw-r--r-- | cpukit/score/src/coresemseize.c | 24 | ||||
-rw-r--r-- | cpukit/score/src/threadhandler.c | 2 |
5 files changed, 33 insertions, 8 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 482554daf8..28bf615748 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2008-05-06 Joel Sherrill <joel.sherrill@OARcorp.com> + + * rtems/include/rtems/rtems/message.h, sapi/include/confdefs.h, + score/src/coresemseize.c, score/src/threadhandler.c: Comment + improvements from class. + 2008-05-06 Joel Sherrill <joel.sherrill@oarcorp.com> PR 1285/rtems diff --git a/cpukit/rtems/include/rtems/rtems/message.h b/cpukit/rtems/include/rtems/rtems/message.h index af81e7ea60..d0118f94e4 100644 --- a/cpukit/rtems/include/rtems/rtems/message.h +++ b/cpukit/rtems/include/rtems/rtems/message.h @@ -81,7 +81,7 @@ typedef enum { * each message queue. */ typedef struct { - /** This field is the inherited obejct characteristics. */ + /** This field is the inherited object characteristics. */ Objects_Control Object; /** This field is the attribute set as defined by the API. */ rtems_attribute attribute_set; diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 7613c71d61..269dfaf74f 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -26,7 +26,7 @@ */ /* - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -1451,8 +1451,9 @@ rtems_configuration_table Configuration = { * will put an end to it. * * NOTE: If you are using the timer driver, it is considered - * mutually exclusive with the clock driver because it - * is assume to use the smae hardware. + * mutually exclusive with the clock driver because the + * drivers are assumed to use the same "timer" hardware + * on many boards. */ #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ diff --git a/cpukit/score/src/coresemseize.c b/cpukit/score/src/coresemseize.c index 71b8a26c8b..6fd59b8d57 100644 --- a/cpukit/score/src/coresemseize.c +++ b/cpukit/score/src/coresemseize.c @@ -7,7 +7,7 @@ * This core object utilizes standard Dijkstra counting semaphores to provide * synchronization and mutual exclusion capabilities. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -69,16 +69,35 @@ void _CORE_semaphore_Seize( return; } + /* + * If the semaphore was not available and the caller was not willing + * to block, then return immediately with a status indicating that + * the semaphore was not available and the caller never blocked. + */ if ( wait == CORE_SEMAPHORE_NO_WAIT ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; return; } - if (wait == CORE_SEMAPHORE_BAD_TIMEOUT ) { + + /* + * This is strange case because normally RTEMS validates parameters + * before performing any real work. But in this case, the POSIX + * API requires that a semaphore be checked for immediate availability + * BEFORE the timeout value is validated. This is implemented in + * RTEMS by indicating a special status that the timeout value + * was invalid which is returned in this case. + */ + if ( wait == CORE_SEMAPHORE_BAD_TIMEOUT ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_SEMAPHORE_BAD_TIMEOUT_VALUE; return; } + + /* + * If the semaphore is not available and the caller is willing to + * block, then we now block the caller with optional timeout. + */ if (( wait == CORE_SEMAPHORE_BLOCK_FOREVER) || ( wait == CORE_SEMAPHORE_BLOCK_WITH_TIMEOUT ) ) { _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); @@ -87,5 +106,4 @@ void _CORE_semaphore_Seize( _ISR_Enable( level ); _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); } - } diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c index f77a4ab3d0..0522061002 100644 --- a/cpukit/score/src/threadhandler.c +++ b/cpukit/score/src/threadhandler.c @@ -2,7 +2,7 @@ * Thread Handler * * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be |