diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-25 20:01:47 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-25 20:01:47 +0000 |
commit | 4b556660f1d4ef76a937a5f2a4a0dc4edb973013 (patch) | |
tree | 6e30cf41fe281db84611522bb5c1af0b141dfafa /cpukit | |
parent | 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-4b556660f1d4ef76a937a5f2a4a0dc4edb973013.tar.bz2 |
2010-08-25 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 164/UNINIT
Coverity Id 165/UNINIT
* posix/src/prwlockinit.c, posix/src/pspininit.c,
score/include/rtems/score/corespinlock.h,
score/inline/rtems/score/corerwlock.inl,
score/inline/rtems/score/corespinlock.inl: Add initialization helpers
for score rwlock and spinlock. Use them from POSIX.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 10 | ||||
-rw-r--r-- | cpukit/posix/src/prwlockinit.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/pspininit.c | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/corespinlock.h | 1 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/corerwlock.inl | 13 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/corespinlock.inl | 13 |
6 files changed, 41 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 2d2ec2068e..4489bc258e 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,13 @@ +2010-08-25 Joel Sherrill <joel.sherrill@oarcorp.com> + + Coverity Id 164/UNINIT + Coverity Id 165/UNINIT + * posix/src/prwlockinit.c, posix/src/pspininit.c, + score/include/rtems/score/corespinlock.h, + score/inline/rtems/score/corerwlock.inl, + score/inline/rtems/score/corespinlock.inl: Add initialization helpers + for score rwlock and spinlock. Use them from POSIX. + 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de> * libcsupport/src/free.c, libcsupport/src/malloc.c, diff --git a/cpukit/posix/src/prwlockinit.c b/cpukit/posix/src/prwlockinit.c index c4174c8931..c79b260b50 100644 --- a/cpukit/posix/src/prwlockinit.c +++ b/cpukit/posix/src/prwlockinit.c @@ -78,8 +78,10 @@ int pthread_rwlock_init( /* * Convert from POSIX attributes to Core RWLock attributes + * + * NOTE: Currently there are no core rwlock attributes */ - /* Currently there are no core rwlock attributes */ + _CORE_RWLock_Initialize_attributes( &the_attributes ); /* * Enter dispatching critical section to allocate and initialize RWLock diff --git a/cpukit/posix/src/pspininit.c b/cpukit/posix/src/pspininit.c index 4fc9d12d8f..bab6ac3140 100644 --- a/cpukit/posix/src/pspininit.c +++ b/cpukit/posix/src/pspininit.c @@ -65,6 +65,8 @@ int pthread_spin_init( return EAGAIN; } + _CORE_spinlock_Initialize_attributes( &attributes ); + _CORE_spinlock_Initialize( &the_spinlock->Spinlock, &attributes ); _Objects_Open_u32( &_POSIX_Spinlock_Information, &the_spinlock->Object, 0 ); diff --git a/cpukit/score/include/rtems/score/corespinlock.h b/cpukit/score/include/rtems/score/corespinlock.h index 907f7bb5b5..e8ba1fde07 100644 --- a/cpukit/score/include/rtems/score/corespinlock.h +++ b/cpukit/score/include/rtems/score/corespinlock.h @@ -32,7 +32,6 @@ extern "C" { #endif #include <rtems/score/thread.h> -#include <rtems/score/thread.h> #include <rtems/score/priority.h> /** diff --git a/cpukit/score/inline/rtems/score/corerwlock.inl b/cpukit/score/inline/rtems/score/corerwlock.inl index 1439f71545..b23ef32015 100644 --- a/cpukit/score/inline/rtems/score/corerwlock.inl +++ b/cpukit/score/inline/rtems/score/corerwlock.inl @@ -31,6 +31,19 @@ #include <rtems/score/thread.h> #include <rtems/score/threadq.h> +/** + * + * This method is used to initialize core rwlock attributes. + * + * @param[in] the_attributes pointer to the attributes to initialize. + */ +RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( + CORE_RWLock_Attributes *the_attributes +) +{ + the_attributes->XXX = 0; +} + /**@}*/ diff --git a/cpukit/score/inline/rtems/score/corespinlock.inl b/cpukit/score/inline/rtems/score/corespinlock.inl index 2cb17165d8..05e3408742 100644 --- a/cpukit/score/inline/rtems/score/corespinlock.inl +++ b/cpukit/score/inline/rtems/score/corespinlock.inl @@ -30,6 +30,19 @@ /** * + * This method is used to initialize core spinlock attributes. + * + * @param[in] the_attributes pointer to the attributes to initialize. + */ +RTEMS_INLINE_ROUTINE void _CORE_spinlock_Initialize_attributes( + CORE_spinlock_Attributes *the_attributes +) +{ + the_attributes->XXX = 0; +} + +/** + * * This method is used to determine if the spinlock is available or not. * * @param[in] the_spinlock will be checked |