2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>

* 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).
This commit is contained in:
Joel Sherrill
2008-12-14 22:48:54 +00:00
parent 1a0e1a7163
commit 41eb1e4090
23 changed files with 80 additions and 62 deletions

View File

@@ -1,3 +1,19 @@
2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* 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).
2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/src/chg_pri.c, itron/src/cre_tsk.c, itron/src/rot_rdq.c,

View File

@@ -25,9 +25,9 @@ void *realloc(
size_t size
)
{
ssize_t old_size;
intptr_t old_size;
char *new_area;
ssize_t resize;
intptr_t resize;
MSBUMP(realloc_calls, 1);

View File

@@ -69,9 +69,9 @@ typedef struct {
Objects_Control Object;
Thread_queue_Control Wait_queue; /* waiting threads */
void *starting_address; /* physical start addr */
uint32_t length; /* physical length(bytes) */
intptr_t length; /* physical length(bytes) */
uint32_t page_size; /* in bytes */
uint32_t maximum_segment_size; /* in bytes */
intptr_t maximum_segment_size; /* in bytes */
rtems_attribute attribute_set;
uint32_t number_of_used_blocks; /* blocks allocated */
Heap_Control Memory;
@@ -106,7 +106,7 @@ void _Region_Manager_initialization(
rtems_status_code rtems_region_create(
rtems_name name,
void *starting_address,
uint32_t length,
intptr_t length,
uint32_t page_size,
rtems_attribute attribute_set,
Objects_Id *id
@@ -123,7 +123,7 @@ rtems_status_code rtems_region_create(
rtems_status_code rtems_region_extend(
Objects_Id id,
void *starting_address,
uint32_t length
intptr_t length
);
/**
@@ -186,7 +186,7 @@ rtems_status_code rtems_region_delete(
*/
rtems_status_code rtems_region_get_segment(
Objects_Id id,
uint32_t size,
intptr_t size,
rtems_option option_set,
rtems_interval timeout,
void **segment
@@ -201,7 +201,7 @@ rtems_status_code rtems_region_get_segment(
rtems_status_code rtems_region_get_segment_size(
Objects_Id id,
void *segment,
size_t *size
intptr_t *size
);
/**
@@ -243,8 +243,8 @@ rtems_status_code rtems_region_return_segment(
rtems_status_code rtems_region_resize_segment(
Objects_Id id,
void *segment,
size_t size,
size_t *old_size
intptr_t size,
intptr_t *old_size
);
#ifndef __RTEMS_APPLICATION__

View File

@@ -50,7 +50,7 @@
rtems_status_code rtems_region_create(
rtems_name name,
void *starting_address,
uint32_t length,
intptr_t length,
uint32_t page_size,
rtems_attribute attribute_set,
Objects_Id *id

View File

@@ -46,10 +46,10 @@
rtems_status_code rtems_region_extend(
Objects_Id id,
void *starting_address,
uint32_t length
intptr_t length
)
{
uint32_t amount_extended;
intptr_t amount_extended;
Heap_Extend_status heap_status;
Objects_Locations location;
rtems_status_code return_status = RTEMS_INTERNAL_ERROR;

View File

@@ -47,7 +47,7 @@
rtems_status_code rtems_region_get_segment(
Objects_Id id,
uint32_t size,
intptr_t size,
rtems_option option_set,
rtems_interval timeout,
void **segment

View File

@@ -45,7 +45,7 @@
rtems_status_code rtems_region_get_segment_size(
Objects_Id id,
void *segment,
size_t *size
intptr_t *size
)
{
Objects_Locations location;

View File

@@ -83,7 +83,7 @@ rtems_status_code _Region_MP_Send_request_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
void *segment,
uint32_t size,
intptr_t size,
rtems_option option_set,
rtems_interval timeout
)

View File

@@ -46,13 +46,13 @@
rtems_status_code rtems_region_resize_segment(
Objects_Id id,
void *segment,
size_t size,
size_t *old_size
intptr_t size,
intptr_t *old_size
)
{
uint32_t avail_size;
intptr_t avail_size;
Objects_Locations location;
uint32_t osize;
intptr_t osize;
rtems_status_code return_status = RTEMS_INTERNAL_ERROR;
Heap_Resize_status status;
register Region_Control *the_region;

View File

@@ -115,7 +115,7 @@ typedef struct {
/** This field specifies the size in bytes of the RTEMS Workspace.
*/
uint32_t work_space_size;
intptr_t work_space_size;
/** This field specifies the maximum number of dynamically installed
* used extensions.

View File

@@ -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
);
/**

View File

@@ -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
);
/**

View File

@@ -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
)
{

View File

@@ -36,7 +36,7 @@
void *_Heap_Allocate(
Heap_Control *the_heap,
size_t size
intptr_t size
)
{
uint32_t the_size;

View File

@@ -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
)
{

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -18,7 +18,7 @@
void *_Protected_heap_Allocate(
Heap_Control *the_heap,
size_t size
intptr_t size
)
{
void *p;

View File

@@ -18,7 +18,7 @@
void *_Protected_heap_Allocate_aligned(
Heap_Control *the_heap,
size_t size,
intptr_t size,
uint32_t alignment
)
{

View File

@@ -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);

View File

@@ -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;

View File

@@ -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(