summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-11 20:38:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-11 20:38:16 +0000
commit2af90ff1a189d4ff80a06d8a547d0e87de7f4033 (patch)
tree429ae74d8dd98f53f243fed84457b508f84bec84 /cpukit
parent2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-2af90ff1a189d4ff80a06d8a547d0e87de7f4033.tar.bz2
2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
* rtems/src/semtranslatereturncode.c, score/include/rtems/score/coremutex.h, score/src/coremutexsurrender.c, score/src/objectinitializeinformation.c: Disable code not reachable when POSIX is not enabled.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog8
-rw-r--r--cpukit/rtems/src/semtranslatereturncode.c4
-rw-r--r--cpukit/score/include/rtems/score/coremutex.h4
-rw-r--r--cpukit/score/src/coremutexsurrender.c8
-rw-r--r--cpukit/score/src/objectinitializeinformation.c13
5 files changed, 28 insertions, 9 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index dff12ea81a..c6c5e97d04 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,13 @@
2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
+ * rtems/src/semtranslatereturncode.c,
+ score/include/rtems/score/coremutex.h,
+ score/src/coremutexsurrender.c,
+ score/src/objectinitializeinformation.c: Disable code not reachable
+ when POSIX is not enabled.
+
+2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
* score/include/rtems/score/context.h: Spacing.
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
diff --git a/cpukit/rtems/src/semtranslatereturncode.c b/cpukit/rtems/src/semtranslatereturncode.c
index b22cf0ff44..23c81dfe26 100644
--- a/cpukit/rtems/src/semtranslatereturncode.c
+++ b/cpukit/rtems/src/semtranslatereturncode.c
@@ -64,11 +64,13 @@
const rtems_status_code _Semaphore_Translate_core_mutex_return_code_[] = {
RTEMS_SUCCESSFUL, /* CORE_MUTEX_STATUS_SUCCESSFUL */
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT */
+#if !defined(RTEMS_POSIX_API)
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED */
+#endif
RTEMS_NOT_OWNER_OF_RESOURCE, /* CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE */
RTEMS_OBJECT_WAS_DELETED, /* CORE_MUTEX_WAS_DELETED */
RTEMS_TIMEOUT, /* CORE_MUTEX_TIMEOUT */
-#ifdef __RTEMS_STRICT_ORDER_MUTEX__
+#if !defined(__RTEMS_STRICT_ORDER_MUTEX__)
CORE_MUTEX_RELEASE_NOT_ORDER,
#endif
RTEMS_INVALID_PRIORITY /* CORE_MUTEX_STATUS_CEILING_VIOLATED */
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h
index c047347327..97c4e5c947 100644
--- a/cpukit/score/include/rtems/score/coremutex.h
+++ b/cpukit/score/include/rtems/score/coremutex.h
@@ -85,10 +85,12 @@ typedef enum {
* resource was unavailable.
*/
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
+#if !defined(RTEMS_POSIX_API)
/** This status indicates that an attempt was made to relock a mutex
* for which nesting is not configured.
*/
CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED,
+#endif
/** This status indicates that an attempt was made to release a mutex
* by a thread other than the thread which locked it.
*/
@@ -103,7 +105,7 @@ typedef enum {
*/
CORE_MUTEX_TIMEOUT,
-#ifdef __RTEMS_STRICT_ORDER_MUTEX__
+#if !defined(__RTEMS_STRICT_ORDER_MUTEX__)
/** This status indicates that a thread not release the mutex which has
* the priority inheritance property in a right order.
*/
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c
index cfe40ab77d..66817dcc4d 100644
--- a/cpukit/score/src/coremutexsurrender.c
+++ b/cpukit/score/src/coremutexsurrender.c
@@ -137,9 +137,11 @@ CORE_mutex_Status _CORE_mutex_Surrender(
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
case CORE_MUTEX_NESTING_ACQUIRES:
return CORE_MUTEX_STATUS_SUCCESSFUL;
- case CORE_MUTEX_NESTING_IS_ERROR:
- /* should never occur */
- return CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
+ #if !defined(RTEMS_POSIX_API)
+ case CORE_MUTEX_NESTING_IS_ERROR:
+ /* should never occur */
+ return CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
+ #endif
case CORE_MUTEX_NESTING_BLOCKS:
/* Currently no API exercises this behavior. */
break;
diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c
index 771637c8ca..c8ef33e466 100644
--- a/cpukit/score/src/objectinitializeinformation.c
+++ b/cpukit/score/src/objectinitializeinformation.c
@@ -128,13 +128,18 @@ void _Objects_Initialize_information(
/*
* Calculate the maximum name length
+ *
+ * NOTE: Always 4 bytes long in Class so aligned. It is POSIX name
+ * lengths that may be an odd number of bytes.
*/
name_length = maximum_name_length;
- if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
- name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
- ~(OBJECTS_NAME_ALIGNMENT-1);
-
+ #if !defined(RTEMS_POSIX_API)
+ if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) )
+ name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
+ ~(OBJECTS_NAME_ALIGNMENT-1);
+ #endif
+
information->name_length = name_length;
_Chain_Initialize_empty( &information->Inactive );