From 252565f24da1ca21bd681acf621201b5318d95d7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 18 Oct 2000 14:57:12 +0000 Subject: 2000-10-18 Nick Simon * src/heapgetinfo.c, include/rtems/score/heap.h, src/Makefile.am: Added _Heap_Get_information() and information control block. * src/heapgetinfo.c: New file. --- c/src/exec/score/include/rtems/score/heap.h | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'c/src/exec/score/include/rtems/score/heap.h') diff --git a/c/src/exec/score/include/rtems/score/heap.h b/c/src/exec/score/include/rtems/score/heap.h index 1a502f7999..10e8cd260f 100644 --- a/c/src/exec/score/include/rtems/score/heap.h +++ b/c/src/exec/score/include/rtems/score/heap.h @@ -35,6 +35,27 @@ typedef enum { HEAP_EXTEND_NOT_IMPLEMENTED } Heap_Extend_status; +/* + * Status codes for _Heap_Get_information + */ + +typedef enum { + HEAP_GET_INFORMATION_SUCCESSFUL = 0, + HEAP_GET_INFORMATION_SYSTEM_STATE_ERROR, + HEAP_GET_INFORMATION_BLOCK_ERROR +} Heap_Get_information_status; + +/* + * Information block returned by _Heap_Get_information + */ + +typedef struct { + unsigned32 free_blocks; + unsigned32 free_size; + unsigned32 used_blocks; + unsigned32 used_size; +} Heap_Information_block; + /* * Constants used in the size/used field of each heap block to * indicate when a block is free or in use. @@ -213,6 +234,29 @@ void _Heap_Walk( boolean do_dump ); +/*PAGE + * + * _Heap_Get_information + * + * This kernel routine walks the heap and tots up the free and allocated + * sizes. Derived from _Heap_Walk. + * + * Input parameters: + * the_heap - pointer to heap header + * the_info - pointer to information block + * + * Output parameters: + * *the_info - status information + * return 0=success, otherwise heap is corrupt. + */ + + +Heap_Get_information_status _Heap_Get_information( + Heap_Control *the_heap, + Heap_Information_block *the_info +); + + #ifndef __RTEMS_APPLICATION__ #include #endif -- cgit v1.2.3