source: rtems/cpukit/rtems/src/regiongetinfo.c @ dea3eccb

4.104.115
Last change on this file since dea3eccb was dea3eccb, checked in by Joel Sherrill <joel.sherrill@…>, on 09/06/09 at 15:24:08

2009-09-06 Sebastian Huber <Sebastian.Huber@…>

  • libcsupport/src/free.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapgetsize.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: Update for heap API changes.
  • score/include/rtems/score/apimutex.h, score/include/rtems/score/object.h: Documentation.
  • score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/inline/rtems/score/heap.inl, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/heapwalk.c: Overall cleanup. Added boundary constraint to allocation function. More changes follow.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  Region Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/rtems/status.h>
21#include <rtems/rtems/support.h>
22#include <rtems/score/object.h>
23#include <rtems/rtems/options.h>
24#include <rtems/rtems/region.h>
25#include <rtems/score/states.h>
26#include <rtems/score/apimutex.h>
27#include <rtems/score/thread.h>
28
29/*PAGE
30 *
31 *  rtems_region_get_information
32 *
33 *  This directive will return information about the region specified.
34 *
35 *  Input parameters:
36 *    id         - region id
37 *    the_info   - pointer to region information block
38 *
39 *  Output parameters:
40 *    *the_info   - region information block filled in
41 *    RTEMS_SUCCESSFUL - if successful
42 *    error code - if unsuccessful
43 */
44
45rtems_status_code rtems_region_get_information(
46  Objects_Id              id,
47  Heap_Information_block *the_info
48)
49{
50  Objects_Locations        location;
51  rtems_status_code        return_status = RTEMS_INTERNAL_ERROR;
52  register Region_Control *the_region;
53
54  if ( !the_info )
55    return RTEMS_INVALID_ADDRESS;
56
57  _RTEMS_Lock_allocator();
58
59    the_region = _Region_Get( id, &location );
60    switch ( location ) {
61
62      case OBJECTS_LOCAL:
63        _Heap_Get_information( &the_region->Memory, the_info );
64        return_status = RTEMS_SUCCESSFUL;
65        break;
66
67#if defined(RTEMS_MULTIPROCESSING)
68      case OBJECTS_REMOTE:        /* this error cannot be returned */
69        break;
70#endif
71
72      case OBJECTS_ERROR:
73        return_status = RTEMS_INVALID_ID;
74        break;
75    }
76
77  _RTEMS_Unlock_allocator();
78  return return_status;
79}
Note: See TracBrowser for help on using the repository browser.