From b2a0214d4395787eca8e74375d283bf26c9ca4a1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 7 Jun 2010 09:35:01 +0000 Subject: 2010-06-07 Sebastian Huber * score/include/rtems/score/heap.h: Declare _Heap_Get_first_and_last_block(). Removed Heap_Extend_status. Changed return type of _Heap_Extend() to bool. * score/inline/rtems/score/heap.inl: Define _Heap_Set_last_block_size(). * score/src/heap.c: Define and use _Heap_Get_first_and_last_block(). * score/src/heapgetinfo.c: Removed assert statements. Do not count the last block. This ensures that all size values are an integral multiple of the page size which is consistent with the other statistics. * score/src/heapextend.c: Implemented support for scattered heap areas. * score/src/heapwalk.c: Dump also last block. Changes for new first and last block values. * ./score/src/pheapextend.c, rtems/src/regionextend.c: Update for _Heap_Extend() changes. --- cpukit/rtems/src/regionextend.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cpukit/rtems') diff --git a/cpukit/rtems/src/regionextend.c b/cpukit/rtems/src/regionextend.c index 0531381328..f4b6c93c2d 100644 --- a/cpukit/rtems/src/regionextend.c +++ b/cpukit/rtems/src/regionextend.c @@ -49,7 +49,7 @@ rtems_status_code rtems_region_extend( ) { uintptr_t amount_extended; - Heap_Extend_status heap_status; + bool extend_ok; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; @@ -64,21 +64,19 @@ rtems_status_code rtems_region_extend( case OBJECTS_LOCAL: - heap_status = _Heap_Extend( + extend_ok = _Heap_Extend( &the_region->Memory, starting_address, length, &amount_extended ); - if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { + if ( extend_ok ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; - } else if ( heap_status == HEAP_EXTEND_ERROR ) { + } else { return_status = RTEMS_INVALID_ADDRESS; - } else /* if ( heap_status == HEAP_EXTEND_NOT_IMPLEMENTED ) */ { - return_status = RTEMS_NOT_IMPLEMENTED; } break; -- cgit v1.2.3