summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-24 15:43:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-07-23 08:01:13 +0200
commitd7665823b208daefb6855591d808e1f3075cedcb (patch)
tree2080d79568c92ae40f9a49f3f82095307766cb1f /cpukit/rtems/src
parentscore: Introduce Thread_queue_Queue (diff)
downloadrtems-d7665823b208daefb6855591d808e1f3075cedcb.tar.bz2
score: Introduce Thread_queue_Heads
Move the storage for the thread queue heads to the threads. Each thread provides a set of thread queue heads allocated from a dedicated memory pool. In case a thread blocks on a queue, then it lends its heads to the queue. In case the thread unblocks, then it takes a free set of threads from the queue. Since a thread can block on at most one queue this works. This mechanism is used in FreeBSD. The motivation for this change is to reduce the memory demands of the synchronization objects. On a 32-bit uni-processor configuration the Thread_queue_Control size is now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced the size as well).
Diffstat (limited to 'cpukit/rtems/src')
-rw-r--r--cpukit/rtems/src/taskcreate.c2
-rw-r--r--cpukit/rtems/src/taskdelete.c5
-rw-r--r--cpukit/rtems/src/taskident.c7
-rw-r--r--cpukit/rtems/src/taskmp.c7
-rw-r--r--cpukit/rtems/src/tasks.c6
5 files changed, 18 insertions, 9 deletions
diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c
index 65a8d33ff1..f8107beb30 100644
--- a/cpukit/rtems/src/taskcreate.c
+++ b/cpukit/rtems/src/taskcreate.c
@@ -177,7 +177,7 @@ rtems_status_code rtems_task_create(
if ( is_global ) {
_Objects_MP_Open(
- &_RTEMS_tasks_Information,
+ &_RTEMS_tasks_Information.Objects,
the_global_object,
name,
the_thread->Object.id
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c
index dc9a2a1961..7a06c51eac 100644
--- a/cpukit/rtems/src/taskdelete.c
+++ b/cpukit/rtems/src/taskdelete.c
@@ -38,7 +38,10 @@ rtems_status_code rtems_task_delete(
case OBJECTS_LOCAL:
#if defined(RTEMS_MULTIPROCESSING)
if ( the_thread->is_global ) {
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id );
+ _Objects_MP_Close(
+ &_RTEMS_tasks_Information.Objects,
+ the_thread->Object.id
+ );
_RTEMS_tasks_MP_Send_process_packet(
RTEMS_TASKS_MP_ANNOUNCE_DELETE,
the_thread->Object.id,
diff --git a/cpukit/rtems/src/taskident.c b/cpukit/rtems/src/taskident.c
index 28b7406c39..c4f1770b10 100644
--- a/cpukit/rtems/src/taskident.c
+++ b/cpukit/rtems/src/taskident.c
@@ -44,7 +44,12 @@ rtems_status_code rtems_task_ident(
return RTEMS_SUCCESSFUL;
}
- status = _Objects_Name_to_id_u32( &_RTEMS_tasks_Information, name, node, id );
+ status = _Objects_Name_to_id_u32(
+ &_RTEMS_tasks_Information.Objects,
+ name,
+ node,
+ id
+ );
return _Status_Object_name_errors_to_status[ status ];
}
diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c
index 339544cdc4..a1386d9bbb 100644
--- a/cpukit/rtems/src/taskmp.c
+++ b/cpukit/rtems/src/taskmp.c
@@ -198,7 +198,7 @@ void _RTEMS_tasks_MP_Process_packet (
case RTEMS_TASKS_MP_ANNOUNCE_CREATE:
ignored = _Objects_MP_Allocate_and_open(
- &_RTEMS_tasks_Information,
+ &_RTEMS_tasks_Information.Objects,
the_packet->name,
the_packet->Prefix.id,
true
@@ -209,7 +209,10 @@ void _RTEMS_tasks_MP_Process_packet (
case RTEMS_TASKS_MP_ANNOUNCE_DELETE:
- _Objects_MP_Close( &_RTEMS_tasks_Information, the_packet->Prefix.id );
+ _Objects_MP_Close(
+ &_RTEMS_tasks_Information.Objects,
+ the_packet->Prefix.id
+ );
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index 5ed891522e..e5a80ee5b8 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -204,19 +204,17 @@ User_extensions_Control _RTEMS_tasks_User_extensions = {
void _RTEMS_tasks_Manager_initialization(void)
{
- _Objects_Initialize_information(
+ _Thread_Initialize_information(
&_RTEMS_tasks_Information, /* object information table */
OBJECTS_CLASSIC_API, /* object API */
OBJECTS_RTEMS_TASKS, /* object class */
Configuration_RTEMS_API.maximum_tasks,
/* maximum objects of this class */
- _Thread_Control_size, /* size of this object's control block */
false, /* true if the name is a string */
RTEMS_MAXIMUM_NAME_LENGTH /* maximum length of an object name */
#if defined(RTEMS_MULTIPROCESSING)
,
- true, /* true if this is a global object class */
- NULL /* Proxy extraction support callout */
+ true /* true if this is a global object class */
#endif
);