source: rtems/cpukit/rtems/src/regiongetinfo.c @ 708fe56

4.104.115
Last change on this file since 708fe56 was 708fe56, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/09 at 00:11:20

2009-09-28 Joel Sherrill <joel.sherrill@…>

  • rtems/src/regiondelete.c, rtems/src/regiongetfreeinfo.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, rtems/src/regionreturnsegment.c: Remove warnings.
  • 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_SUCCESSFUL;
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        break;
65
66#if defined(RTEMS_MULTIPROCESSING)
67      case OBJECTS_REMOTE:        /* this error cannot be returned */
68        break;
69#endif
70
71      case OBJECTS_ERROR:
72        return_status = RTEMS_INVALID_ID;
73        break;
74    }
75
76  _RTEMS_Unlock_allocator();
77  return return_status;
78}
Note: See TracBrowser for help on using the repository browser.