From 41eb1e40900196835f903485a6f81637e6b2210f Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 14 Dec 2008 22:48:54 +0000 Subject: 2008-12-14 Joel Sherrill * libcsupport/src/realloc.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionmp.c, rtems/src/regionresizesegment.c, sapi/include/rtems/config.h, score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapgetblocksize.c, score/src/pheapresizeblock.c: Change sizes of heap/region and allocated objects in heap to intptr_t so they can be larger than a single allocatable object (e.g. size_t). --- cpukit/score/include/rtems/score/heap.h | 24 ++++++++++++------------ cpukit/score/include/rtems/score/protectedheap.h | 12 ++++++------ cpukit/score/src/heap.c | 2 +- cpukit/score/src/heapallocate.c | 2 +- cpukit/score/src/heapallocatealigned.c | 16 +++++++++------- cpukit/score/src/heapextend.c | 4 ++-- cpukit/score/src/heapresizeblock.c | 6 +++--- cpukit/score/src/heapsizeofuserarea.c | 2 +- cpukit/score/src/pheapallocate.c | 2 +- cpukit/score/src/pheapallocatealigned.c | 2 +- cpukit/score/src/pheapextend.c | 4 ++-- cpukit/score/src/pheapgetblocksize.c | 2 +- cpukit/score/src/pheapresizeblock.c | 6 +++--- 13 files changed, 43 insertions(+), 41 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index 0587852d78..286205dffc 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -145,11 +145,11 @@ typedef struct { /** instance number of this heap */ uint32_t instance; /** the size of the memory for heap */ - uint32_t size; + intptr_t size; /** current free size */ - uint32_t free_size; + intptr_t free_size; /** minimum free size ever */ - uint32_t min_free_size; + intptr_t min_free_size; /** current number of free blocks */ uint32_t free_blocks; /** maximum number of free blocks ever */ @@ -262,7 +262,7 @@ typedef struct { uint32_t _Heap_Initialize( Heap_Control *the_heap, void *starting_address, - size_t size, + intptr_t size, uint32_t page_size ); @@ -281,8 +281,8 @@ uint32_t _Heap_Initialize( Heap_Extend_status _Heap_Extend( Heap_Control *the_heap, void *starting_address, - size_t size, - uint32_t *amount_extended + intptr_t size, + intptr_t *amount_extended ); /** @@ -296,7 +296,7 @@ Heap_Extend_status _Heap_Extend( */ void *_Heap_Allocate( Heap_Control *the_heap, - size_t size + intptr_t size ); /** @@ -315,7 +315,7 @@ void *_Heap_Allocate( */ void *_Heap_Allocate_aligned( Heap_Control *the_heap, - size_t size, + intptr_t size, uint32_t alignment ); @@ -336,7 +336,7 @@ void *_Heap_Allocate_aligned( bool _Heap_Size_of_user_area( Heap_Control *the_heap, void *starting_address, - size_t *size + intptr_t *size ); /** @@ -364,9 +364,9 @@ bool _Heap_Size_of_user_area( Heap_Resize_status _Heap_Resize_block( Heap_Control *the_heap, void *starting_address, - size_t size, - uint32_t *old_mem_size, - uint32_t *avail_mem_size + intptr_t size, + intptr_t *old_mem_size, + intptr_t *avail_mem_size ); /** diff --git a/cpukit/score/include/rtems/score/protectedheap.h b/cpukit/score/include/rtems/score/protectedheap.h index 78c2abc3d2..1d71ac9b3f 100644 --- a/cpukit/score/include/rtems/score/protectedheap.h +++ b/cpukit/score/include/rtems/score/protectedheap.h @@ -54,7 +54,7 @@ extern "C" { static inline uint32_t _Protected_heap_Initialize( Heap_Control *the_heap, void *starting_address, - size_t size, + intptr_t size, uint32_t page_size ) { @@ -74,7 +74,7 @@ static inline uint32_t _Protected_heap_Initialize( bool _Protected_heap_Extend( Heap_Control *the_heap, void *starting_address, - size_t size + intptr_t size ); /** @@ -88,7 +88,7 @@ bool _Protected_heap_Extend( */ void *_Protected_heap_Allocate( Heap_Control *the_heap, - size_t size + intptr_t size ); /** @@ -107,7 +107,7 @@ void *_Protected_heap_Allocate( */ void *_Protected_heap_Allocate_aligned( Heap_Control *the_heap, - size_t size, + intptr_t size, uint32_t alignment ); @@ -128,7 +128,7 @@ void *_Protected_heap_Allocate_aligned( bool _Protected_heap_Get_block_size( Heap_Control *the_heap, void *starting_address, - size_t *size + intptr_t *size ); /** @@ -146,7 +146,7 @@ bool _Protected_heap_Get_block_size( bool _Protected_heap_Resize_block( Heap_Control *the_heap, void *starting_address, - size_t size + intptr_t size ); /** diff --git a/cpukit/score/src/heap.c b/cpukit/score/src/heap.c index 042dc6d604..014df39d74 100644 --- a/cpukit/score/src/heap.c +++ b/cpukit/score/src/heap.c @@ -115,7 +115,7 @@ static uint32_t instance = 0; uint32_t _Heap_Initialize( Heap_Control *the_heap, void *starting_address, - size_t size, + intptr_t size, uint32_t page_size ) { diff --git a/cpukit/score/src/heapallocate.c b/cpukit/score/src/heapallocate.c index 418ee758fc..86164d209c 100644 --- a/cpukit/score/src/heapallocate.c +++ b/cpukit/score/src/heapallocate.c @@ -36,7 +36,7 @@ void *_Heap_Allocate( Heap_Control *the_heap, - size_t size + intptr_t size ) { uint32_t the_size; diff --git a/cpukit/score/src/heapallocatealigned.c b/cpukit/score/src/heapallocatealigned.c index 3fda404490..d96cdb7c67 100644 --- a/cpukit/score/src/heapallocatealigned.c +++ b/cpukit/score/src/heapallocatealigned.c @@ -23,11 +23,12 @@ static void check_result( - Heap_Control* the_heap, - Heap_Block* the_block, - _H_uptr_t user_addr, - _H_uptr_t aligned_user_addr, - uint32_t size) + Heap_Control *the_heap, + Heap_Block *the_block, + _H_uptr_t user_addr, + _H_uptr_t aligned_user_addr, + intptr_t size +) { _H_uptr_t const user_area = _H_p2u(_Heap_User_area(the_block)); _H_uptr_t const block_end = _H_p2u(the_block) @@ -73,7 +74,8 @@ static Heap_Block *block_allocate( Heap_Control *the_heap, Heap_Block *the_block, - uint32_t alloc_size) + intptr_t alloc_size +) { Heap_Statistics *const stats = &the_heap->stats; uint32_t const block_size = _Heap_Block_size(the_block); @@ -131,7 +133,7 @@ Heap_Block *block_allocate( void *_Heap_Allocate_aligned( Heap_Control *the_heap, - size_t size, + intptr_t size, uint32_t alignment ) { diff --git a/cpukit/score/src/heapextend.c b/cpukit/score/src/heapextend.c index 73eb91f127..340fc84db2 100644 --- a/cpukit/score/src/heapextend.c +++ b/cpukit/score/src/heapextend.c @@ -38,8 +38,8 @@ Heap_Extend_status _Heap_Extend( Heap_Control *the_heap, void *starting_address, - size_t size, - uint32_t *amount_extended + intptr_t size, + intptr_t *amount_extended ) { uint32_t the_size; diff --git a/cpukit/score/src/heapresizeblock.c b/cpukit/score/src/heapresizeblock.c index 49460f9767..c744d4ff88 100644 --- a/cpukit/score/src/heapresizeblock.c +++ b/cpukit/score/src/heapresizeblock.c @@ -47,9 +47,9 @@ Heap_Resize_status _Heap_Resize_block( Heap_Control *the_heap, void *starting_address, - size_t size, - uint32_t *old_mem_size, - uint32_t *avail_mem_size + intptr_t size, + intptr_t *old_mem_size, + intptr_t *avail_mem_size ) { Heap_Block *the_block; diff --git a/cpukit/score/src/heapsizeofuserarea.c b/cpukit/score/src/heapsizeofuserarea.c index c1555d2ccc..d7c6f0f9b9 100644 --- a/cpukit/score/src/heapsizeofuserarea.c +++ b/cpukit/score/src/heapsizeofuserarea.c @@ -42,7 +42,7 @@ bool _Heap_Size_of_user_area( Heap_Control *the_heap, void *starting_address, - size_t *size + intptr_t *size ) { Heap_Block *the_block; diff --git a/cpukit/score/src/pheapallocate.c b/cpukit/score/src/pheapallocate.c index a0841bc653..f864a4a435 100644 --- a/cpukit/score/src/pheapallocate.c +++ b/cpukit/score/src/pheapallocate.c @@ -18,7 +18,7 @@ void *_Protected_heap_Allocate( Heap_Control *the_heap, - size_t size + intptr_t size ) { void *p; diff --git a/cpukit/score/src/pheapallocatealigned.c b/cpukit/score/src/pheapallocatealigned.c index 1e1706063b..97873f9b29 100644 --- a/cpukit/score/src/pheapallocatealigned.c +++ b/cpukit/score/src/pheapallocatealigned.c @@ -18,7 +18,7 @@ void *_Protected_heap_Allocate_aligned( Heap_Control *the_heap, - size_t size, + intptr_t size, uint32_t alignment ) { diff --git a/cpukit/score/src/pheapextend.c b/cpukit/score/src/pheapextend.c index 2d8d4ac3a3..d391018d0d 100644 --- a/cpukit/score/src/pheapextend.c +++ b/cpukit/score/src/pheapextend.c @@ -19,11 +19,11 @@ bool _Protected_heap_Extend( Heap_Control *the_heap, void *starting_address, - size_t size + intptr_t size ) { Heap_Extend_status status; - uint32_t amount_extended; + intptr_t amount_extended; _RTEMS_Lock_allocator(); status = _Heap_Extend(the_heap, starting_address, size, &amount_extended); diff --git a/cpukit/score/src/pheapgetblocksize.c b/cpukit/score/src/pheapgetblocksize.c index 029ef7b2c7..0e6cd80ea5 100644 --- a/cpukit/score/src/pheapgetblocksize.c +++ b/cpukit/score/src/pheapgetblocksize.c @@ -19,7 +19,7 @@ bool _Protected_heap_Get_block_size( Heap_Control *the_heap, void *starting_address, - size_t *size + intptr_t *size ) { bool status; diff --git a/cpukit/score/src/pheapresizeblock.c b/cpukit/score/src/pheapresizeblock.c index 589a520e0d..45e7861509 100644 --- a/cpukit/score/src/pheapresizeblock.c +++ b/cpukit/score/src/pheapresizeblock.c @@ -19,12 +19,12 @@ bool _Protected_heap_Resize_block( Heap_Control *the_heap, void *starting_address, - size_t size + intptr_t size ) { Heap_Resize_status status; - uint32_t old_mem_size; - uint32_t avail_mem_size; + intptr_t old_mem_size; + intptr_t avail_mem_size; _RTEMS_Lock_allocator(); status = _Heap_Resize_block( -- cgit v1.2.3