summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/regiongetsegmentsize.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-07-01 22:32:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-07-01 22:32:31 +0000
commit90015e7f864274881572362aa19530b608e5b540 (patch)
tree18898ad469cb28aeccefd93b79d7452767df0d59 /cpukit/rtems/src/regiongetsegmentsize.c
parent2002-07-01 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-90015e7f864274881572362aa19530b608e5b540.tar.bz2
2002-07-01 Joel Sherrill <joel@OARcorp.com>
* Mega patch merge to change the format of the object IDs to loosen the dependency between the SCORE and the various APIs. There was considerable work to simplify the object name management and it appears that the name_table field is no longer needed. This patch also includes the addition of the internal mutex which is currently only used to protect some types of allocation and deallocation. This significantly can reduce context switch latency under certain circumstances. In particular, some heap/region operations were O(n) and had dispatching disabled. This should help enormously. With this merge, the patch is not as clean as it should be. In particular, the documentation has not been modified to reflect the new object ID layout, the IDs in the test screens are not updated, and _Objects_Get_information needs to be a real routine not inlined. As part of this patch a lot of MP code for thread/proxy blocking was made conditional and cleaned up. * include/rtems.h, inline/rtems/rtems/region.inl, macros/rtems/rtems/region.inl, src/dpmem.c, src/dpmemcreate.c, src/msg.c, src/msgqcreate.c, src/part.c, src/partcreate.c, src/ratemon.c, src/ratemoncreate.c, src/region.c, src/regioncreate.c, src/regiondelete.c, src/regionextend.c, src/regiongetinfo.c, src/regiongetsegment.c, src/regiongetsegmentsize.c, src/regionident.c, src/regionreturnsegment.c, src/rtemstimer.c, src/sem.c, src/semcreate.c, src/taskcreate.c, src/taskident.c, src/tasks.c, src/timercreate.c: Modified as part of above.
Diffstat (limited to 'cpukit/rtems/src/regiongetsegmentsize.c')
-rw-r--r--cpukit/rtems/src/regiongetsegmentsize.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpukit/rtems/src/regiongetsegmentsize.c b/cpukit/rtems/src/regiongetsegmentsize.c
index 63d8c96b1c..abdf755173 100644
--- a/cpukit/rtems/src/regiongetsegmentsize.c
+++ b/cpukit/rtems/src/regiongetsegmentsize.c
@@ -20,6 +20,7 @@
#include <rtems/rtems/region.h>
#include <rtems/score/states.h>
#include <rtems/score/thread.h>
+#include <rtems/score/apimutex.h>
/*PAGE
*
@@ -48,22 +49,25 @@ rtems_status_code rtems_region_get_segment_size(
Objects_Locations location;
Thread_Control *executing;
+ _RTEMS_Lock_allocator();
executing = _Thread_Executing;
the_region = _Region_Get( id, &location );
switch ( location ) {
case OBJECTS_REMOTE: /* this error cannot be returned */
+ _RTEMS_Unlock_allocator();
return RTEMS_INTERNAL_ERROR;
case OBJECTS_ERROR:
+ _RTEMS_Unlock_allocator();
return RTEMS_INVALID_ID;
case OBJECTS_LOCAL:
if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) {
- _Thread_Enable_dispatch();
+ _RTEMS_Unlock_allocator();
return RTEMS_SUCCESSFUL;
}
- _Thread_Enable_dispatch();
+ _RTEMS_Unlock_allocator();
return RTEMS_INVALID_ADDRESS;
}