summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-05 14:36:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 09:08:20 +0200
commit97312fcc6da163d76b69bf8ce68fd791cf014c2a (patch)
tree6599b770a1587356b02b92b4003489f2e9bf8bc5 /cpukit/posix
parentbsp/atsam: Fix mbuf allocation (diff)
downloadrtems-97312fcc6da163d76b69bf8ce68fd791cf014c2a.tar.bz2
score: Delete Thread_Wait_information::id
This field was only by the monitor in non-multiprocessing configurations. Add new field Thread_Wait_information::remote_id in multiprocessing configurations and use it for the remote procedure call thread queue. Add _Thread_Wait_get_id() to obtain the object identifier for debug and system information tools. Ensure the object layout via static asserts. Add test cases to sptests/spthreadq01.
Diffstat (limited to 'cpukit/posix')
-rw-r--r--cpukit/posix/include/rtems/posix/cond.h2
-rw-r--r--cpukit/posix/include/rtems/posix/mqueue.h2
-rw-r--r--cpukit/posix/include/rtems/posix/mutex.h2
-rw-r--r--cpukit/posix/include/rtems/posix/semaphore.h2
-rw-r--r--cpukit/posix/src/condwaitsupp.c7
-rw-r--r--cpukit/posix/src/mqueuerecvsupp.c6
-rw-r--r--cpukit/posix/src/mutexlocksupp.c3
-rw-r--r--cpukit/posix/src/pbarrierwait.c4
-rw-r--r--cpukit/posix/src/prwlockwrlock.c4
-rw-r--r--cpukit/posix/src/semaphorewaitsupp.c6
10 files changed, 31 insertions, 7 deletions
diff --git a/cpukit/posix/include/rtems/posix/cond.h b/cpukit/posix/include/rtems/posix/cond.h
index 00a0fdb9a4..1839279591 100644
--- a/cpukit/posix/include/rtems/posix/cond.h
+++ b/cpukit/posix/include/rtems/posix/cond.h
@@ -42,9 +42,9 @@ extern "C" {
typedef struct {
Objects_Control Object;
+ Thread_queue_Control Wait_queue;
int process_shared;
pthread_mutex_t Mutex;
- Thread_queue_Control Wait_queue;
} POSIX_Condition_variables_Control;
#ifdef __cplusplus
diff --git a/cpukit/posix/include/rtems/posix/mqueue.h b/cpukit/posix/include/rtems/posix/mqueue.h
index 473183d4bc..9e74fb6dbd 100644
--- a/cpukit/posix/include/rtems/posix/mqueue.h
+++ b/cpukit/posix/include/rtems/posix/mqueue.h
@@ -54,11 +54,11 @@ extern "C" {
typedef struct {
Objects_Control Object;
+ CORE_message_queue_Control Message_queue;
int process_shared;
bool named;
bool linked;
uint32_t open_count;
- CORE_message_queue_Control Message_queue;
struct sigevent notification;
} POSIX_Message_queue_Control;
diff --git a/cpukit/posix/include/rtems/posix/mutex.h b/cpukit/posix/include/rtems/posix/mutex.h
index 5243d4cbbb..bc8e529042 100644
--- a/cpukit/posix/include/rtems/posix/mutex.h
+++ b/cpukit/posix/include/rtems/posix/mutex.h
@@ -42,8 +42,8 @@ extern "C" {
typedef struct {
Objects_Control Object;
- int process_shared;
CORE_mutex_Control Mutex;
+ int process_shared;
} POSIX_Mutex_Control;
/** @} */
diff --git a/cpukit/posix/include/rtems/posix/semaphore.h b/cpukit/posix/include/rtems/posix/semaphore.h
index 5aef39b7ec..45de4a93b9 100644
--- a/cpukit/posix/include/rtems/posix/semaphore.h
+++ b/cpukit/posix/include/rtems/posix/semaphore.h
@@ -42,11 +42,11 @@ extern "C" {
typedef struct {
Objects_Control Object;
+ CORE_semaphore_Control Semaphore;
int process_shared;
bool named;
bool linked;
uint32_t open_count;
- CORE_semaphore_Control Semaphore;
/*
* sem_t is 32-bit. If Object_Id is 16-bit, then they are not
* interchangeable. We have to be able to return a pointer to
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c
index d4e2403058..0a7e30850d 100644
--- a/cpukit/posix/src/condwaitsupp.c
+++ b/cpukit/posix/src/condwaitsupp.c
@@ -24,9 +24,15 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
#include <rtems/score/statesimpl.h>
+#include <rtems/score/threadimpl.h>
#include <rtems/posix/condimpl.h>
#include <rtems/posix/muteximpl.h>
+THREAD_WAIT_QUEUE_OBJECT_ASSERT(
+ POSIX_Condition_variables_Control,
+ Wait_queue
+);
+
int _POSIX_Condition_variables_Wait_support(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
@@ -75,7 +81,6 @@ int _POSIX_Condition_variables_Wait_support(
executing = _Thread_Executing;
executing->Wait.return_code = 0;
- executing->Wait.id = *cond;
_Thread_queue_Enqueue(
&the_cond->Wait_queue,
diff --git a/cpukit/posix/src/mqueuerecvsupp.c b/cpukit/posix/src/mqueuerecvsupp.c
index 54d0ac1d7f..bbbc23443c 100644
--- a/cpukit/posix/src/mqueuerecvsupp.c
+++ b/cpukit/posix/src/mqueuerecvsupp.c
@@ -28,9 +28,15 @@
#include <rtems/system.h>
#include <rtems/score/watchdog.h>
+#include <rtems/score/threadimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
+THREAD_WAIT_QUEUE_OBJECT_ASSERT(
+ POSIX_Message_queue_Control,
+ Message_queue.Wait_queue
+);
+
/*
* _POSIX_Message_queue_Receive_support
*
diff --git a/cpukit/posix/src/mutexlocksupp.c b/cpukit/posix/src/mutexlocksupp.c
index cd95a976d8..0ec9b852b2 100644
--- a/cpukit/posix/src/mutexlocksupp.c
+++ b/cpukit/posix/src/mutexlocksupp.c
@@ -24,9 +24,12 @@
#include <rtems/system.h>
#include <rtems/score/coremuteximpl.h>
#include <rtems/score/watchdog.h>
+#include <rtems/score/threadimpl.h>
#include <rtems/posix/muteximpl.h>
#include <rtems/posix/priorityimpl.h>
+THREAD_WAIT_QUEUE_OBJECT_ASSERT( POSIX_Mutex_Control, Mutex.Wait_queue );
+
/*
* _POSIX_Mutex_Lock_support
*
diff --git a/cpukit/posix/src/pbarrierwait.c b/cpukit/posix/src/pbarrierwait.c
index df4472b931..560e10146d 100644
--- a/cpukit/posix/src/pbarrierwait.c
+++ b/cpukit/posix/src/pbarrierwait.c
@@ -22,7 +22,9 @@
#include <errno.h>
#include <rtems/posix/barrierimpl.h>
-#include <rtems/score/thread.h>
+#include <rtems/score/threadimpl.h>
+
+THREAD_WAIT_QUEUE_OBJECT_ASSERT( POSIX_Barrier_Control, Barrier.Wait_queue );
/**
* This directive allows a thread to wait at a barrier.
diff --git a/cpukit/posix/src/prwlockwrlock.c b/cpukit/posix/src/prwlockwrlock.c
index 67774648ad..1905460a2a 100644
--- a/cpukit/posix/src/prwlockwrlock.c
+++ b/cpukit/posix/src/prwlockwrlock.c
@@ -24,7 +24,9 @@
#include <errno.h>
#include <rtems/posix/rwlockimpl.h>
-#include <rtems/score/thread.h>
+#include <rtems/score/threadimpl.h>
+
+THREAD_WAIT_QUEUE_OBJECT_ASSERT( POSIX_RWLock_Control, RWLock.Wait_queue );
/*
* pthread_rwlock_wrlock
diff --git a/cpukit/posix/src/semaphorewaitsupp.c b/cpukit/posix/src/semaphorewaitsupp.c
index 5c055bea41..cf8fe63c93 100644
--- a/cpukit/posix/src/semaphorewaitsupp.c
+++ b/cpukit/posix/src/semaphorewaitsupp.c
@@ -27,9 +27,15 @@
#include <limits.h>
#include <rtems/system.h>
+#include <rtems/score/threadimpl.h>
#include <rtems/posix/semaphoreimpl.h>
#include <rtems/seterr.h>
+THREAD_WAIT_QUEUE_OBJECT_ASSERT(
+ POSIX_Semaphore_Control,
+ Semaphore.Wait_queue
+);
+
int _POSIX_Semaphore_Wait_support(
sem_t *sem,
bool blocking,