diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-13 16:48:22 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-13 16:48:22 +0000 |
commit | f7e4067f3c60e1aae26dceac3f8c1d5f637930d8 (patch) | |
tree | bb161579b2369bb7ab94e03272f6fb8e1312cd47 /cpukit/score | |
parent | 2009-05-08 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-f7e4067f3c60e1aae26dceac3f8c1d5f637930d8.tar.bz2 |
2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1411/cpukit
* rtems/src/workspace.c, score/include/rtems/score/protectedheap.h,
score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c: Improve
workspace wrapper methods.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/protectedheap.h | 6 | ||||
-rw-r--r-- | cpukit/score/src/pheapgetfreeinfo.c | 8 | ||||
-rw-r--r-- | cpukit/score/src/pheapgetinfo.c | 13 |
3 files changed, 23 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/protectedheap.h b/cpukit/score/include/rtems/score/protectedheap.h index 78c2abc3d2..4840ddd7a7 100644 --- a/cpukit/score/include/rtems/score/protectedheap.h +++ b/cpukit/score/include/rtems/score/protectedheap.h @@ -185,8 +185,10 @@ bool _Protected_heap_Walk( * * @param[in] the_heap pointer to heap header * @param[in] the_info pointer to a status information area + * + * @return true if successfully able to return information */ -void _Protected_heap_Get_information( +bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ); @@ -200,7 +202,7 @@ void _Protected_heap_Get_information( * * @return free block information filled in. */ -void _Protected_heap_Get_free_information( +bool _Protected_heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ); diff --git a/cpukit/score/src/pheapgetfreeinfo.c b/cpukit/score/src/pheapgetfreeinfo.c index bba8a90b18..4b211d93dd 100644 --- a/cpukit/score/src/pheapgetfreeinfo.c +++ b/cpukit/score/src/pheapgetfreeinfo.c @@ -16,13 +16,19 @@ #include <rtems/system.h> #include <rtems/score/protectedheap.h> -void _Protected_heap_Get_free_information( +bool _Protected_heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { + /* + * TBD: _Heap_Get_free_information does not error check or return status. + */ + _RTEMS_Lock_allocator(); _Heap_Get_free_information( the_heap, info ); _RTEMS_Unlock_allocator(); + + return true; } diff --git a/cpukit/score/src/pheapgetinfo.c b/cpukit/score/src/pheapgetinfo.c index 26e15d1d5c..1d62fc0673 100644 --- a/cpukit/score/src/pheapgetinfo.c +++ b/cpukit/score/src/pheapgetinfo.c @@ -16,14 +16,25 @@ #include <rtems/system.h> #include <rtems/score/protectedheap.h> -void _Protected_heap_Get_information( +bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Get_information_status status; + if ( !the_heap ) + return false; + + if ( !the_info ) + return false; + _RTEMS_Lock_allocator(); status = _Heap_Get_information( the_heap, the_info ); _RTEMS_Unlock_allocator(); + + if ( status == HEAP_GET_INFORMATION_SUCCESSFUL ) + return true; + + return false; } |