Changeset 9b3f187 in rtems


Ignore:
Timestamp:
Nov 29, 2004, 10:45:43 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
4406c2f
Parents:
55243362
Message:

2004-11-29 Joel Sherrill <joel@…>

  • libcsupport/src/mallocfreespace.c, rtems/Makefile.am, rtems/include/rtems/rtems/region.h, score/Makefile.am, score/include/rtems/score/heap.h, score/src/heapgetinfo.c: Add capability to return information about just the free blocks in a region or heap. Also changed the semantics of free space available to be the largest block of memory that can be allocated.
  • rtems/src/regiongetfreeinfo.c, score/src/heapgetfreeinfo.c: New files. : score/include/rtems/score/object.h, score/src/objectinitializeinformation.c: Remove warning.
Location:
cpukit
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r55243362 r9b3f187  
     12004-11-29      Joel Sherrill <joel@OARcorp.com>
     2
     3        * libcsupport/src/mallocfreespace.c, rtems/Makefile.am,
     4        rtems/include/rtems/rtems/region.h, score/Makefile.am,
     5        score/include/rtems/score/heap.h, score/src/heapgetinfo.c: Add
     6        capability to return information about just the free blocks in a
     7        region or heap.  Also changed the semantics of free space available
     8        to be the largest block of memory that can be allocated.
     9        * rtems/src/regiongetfreeinfo.c, score/src/heapgetfreeinfo.c: New files.
     10        : score/include/rtems/score/object.h,
     11        score/src/objectinitializeinformation.c: Remove warning.
     12
    1132004-11-22      Joel Sherrill <joel@OARcorp.com>
    214
  • cpukit/libcsupport/src/mallocfreespace.c

    r55243362 r9b3f187  
    3838  region_information_block   heap_info;
    3939
    40   if ( !rtems_region_get_information( RTEMS_Malloc_Heap, &heap_info ) ) {
    41     return (size_t) heap_info.free_size;
     40  if ( !rtems_region_get_free_information( RTEMS_Malloc_Heap, &heap_info ) ) {
     41    return (size_t) heap_info.Free.largest;
    4242  }
    4343  return (size_t) -1;
  • cpukit/rtems/Makefile.am

    r55243362 r9b3f187  
    108108REGION_C_FILES = src/region.c src/regioncreate.c src/regiondelete.c \
    109109    src/regionextend.c src/regiongetsegment.c src/regiongetsegmentsize.c \
    110     src/regionident.c src/regionreturnsegment.c src/regiongetinfo.c
     110    src/regionident.c src/regionreturnsegment.c src/regiongetinfo.c \
     111    src/regiongetfreeinfo.c
    111112
    112113PARTITION_C_FILES = src/part.c src/partcreate.c src/partdelete.c \
  • cpukit/rtems/include/rtems/rtems/region.h

    r55243362 r9b3f187  
    135135
    136136/*
    137  *  rtems_region_ident
     137 *  rtems_region_get_information
    138138 *
    139139 *  DESCRIPTION:
     
    145145
    146146rtems_status_code rtems_region_get_information(
     147  Objects_Id              id,
     148  Heap_Information_block *the_info
     149);
     150
     151/*
     152 *  rtems_region_get_free_information
     153 *
     154 *  DESCRIPTION:
     155 *
     156 *  This routine implements the rtems_region_get_free_information directive.
     157 *  This directive returns information about the free blocks in the
     158 *  heap associated with this region.
     159 */
     160
     161rtems_status_code rtems_region_get_free_information(
    147162  Objects_Id              id,
    148163  Heap_Information_block *the_info
  • cpukit/score/Makefile.am

    r55243362 r9b3f187  
    9595
    9696HEAP_C_FILES = src/heap.c src/heapallocate.c src/heapextend.c src/heapfree.c \
    97     src/heapsizeofuserarea.c src/heapwalk.c src/heapgetinfo.c
     97    src/heapsizeofuserarea.c src/heapwalk.c src/heapgetinfo.c \
     98    src/heapgetfreeinfo.c
    9899
    99100OBJECT_C_FILES = src/object.c src/objectallocate.c \
  • cpukit/score/include/rtems/score/heap.h

    r55243362 r9b3f187  
    5656
    5757/**
     58 *  Information block returned by the Heap routines used to
     59 *  obtain statistics.  This information is returned about
     60 *  either free or used blocks.
     61 */
     62
     63typedef struct {
     64  /** Number of blocks of this type. */
     65  uint32_t number;
     66  /** Largest blocks of this type. */
     67  uint32_t largest;
     68  /** Total size of the blocks of this type. */
     69  uint32_t total;
     70
     71} Heap_Information;
     72
     73
     74/**
    5875 *  Information block returned by _Heap_Get_information
    5976 */
    6077typedef struct {
    61   /** This field is the number of free blocks in this heap. */
    62   uint32_t     free_blocks;
    63   /** This field is the amount of free memory in this heap. */
    64   uint32_t     free_size;
    65   /** This field is the number of used blocks in this heap. */
    66   uint32_t     used_blocks;
    67   /** This field is the amount of used memory in this heap. */
    68   uint32_t     used_size;
     78  /** This field is information on the used blocks in the heap. */
     79  Heap_Information Free;
     80  /** This field is information on the used blocks in the heap. */
     81  Heap_Information Used;
    6982} Heap_Information_block;
    7083
     
    279292);
    280293
     294/**
     295 *  This heap routine returns information about the free blocks
     296 *  in the specified heap.
     297 * 
     298 *  @param the_heap (in) pointer to heap header.
     299 *  @param info (in) pointer to the free block information.
     300 * 
     301 *  @return free block information filled in.
     302 */
     303   
     304void _Heap_Get_free_information(
     305  Heap_Control        *the_heap,
     306  Heap_Information    *info
     307);
    281308
    282309#ifndef __RTEMS_APPLICATION__
  • cpukit/score/include/rtems/score/object.h

    r55243362 r9b3f187  
    232232  boolean           is_string;          /* TRUE if names are strings */
    233233  uint16_t          name_length;        /* maximum length of names */
    234   Objects_Thread_queue_Extract_callout *extract;
     234  Objects_Thread_queue_Extract_callout extract;
    235235#if defined(RTEMS_MULTIPROCESSING)
    236236  Chain_Control    *global_table;       /* pointer to global table */
     
    352352  ,
    353353  boolean              supports_global,
    354   Objects_Thread_queue_Extract_callout *extract
     354  Objects_Thread_queue_Extract_callout extract
    355355#endif
    356356);
  • cpukit/score/src/heapgetinfo.c

    r55243362 r9b3f187  
    4141  Heap_Block *next_block = 0;  /* avoid warnings */
    4242  int         notdone = 1;
     43  uint32_t    size;
    4344
    4445
    45   the_info->free_blocks = 0;
    46   the_info->free_size   = 0;
    47   the_info->used_blocks = 0;
    48   the_info->used_size   = 0;
     46  the_info->Free.number  = 0;
     47  the_info->Free.total   = 0;
     48  the_info->Free.largest = 0;
     49  the_info->Used.number  = 0;
     50  the_info->Used.total   = 0;
     51  the_info->Used.largest = 0;
    4952
    5053  /*
     
    7376       */
    7477
     78      size = _Heap_Block_size(the_block);
    7579      if ( _Heap_Is_block_free(the_block) ) {
    76         the_info->free_blocks++;
    77         the_info->free_size += _Heap_Block_size(the_block);
     80        the_info->Free.number++;
     81        the_info->Free.total += size;
     82        if ( size > the_info->Free.largest )
     83          the_info->Free.largest = size;
    7884      } else {
    79         the_info->used_blocks++;
    80         the_info->used_size += _Heap_Block_size(the_block);
     85        the_info->Used.number++;
     86        the_info->Used.total += size;
     87        if ( size > the_info->Used.largest )
     88          the_info->Used.largest = size;
    8189      }
    8290
  • cpukit/score/src/objectinitializeinformation.c

    r55243362 r9b3f187  
    3939 *    When multiprocessing is configured,
    4040 *      supports_global     - TRUE if this is a global object class
    41  *      extract_callout     - pointer to threadq extract callout if MP
     41 *      extract_callout     - pointer to threadq extract callout
    4242 *
    4343 *  Output parameters:  NONE
     
    5555  ,
    5656  boolean              supports_global,
    57   Objects_Thread_queue_Extract_callout *extract
     57  Objects_Thread_queue_Extract_callout extract
    5858#endif
    5959)
Note: See TracChangeset for help on using the changeset viewer.