source: rtems/cpukit/rtems/src/regiongetinfo.c @ 422289e

4.104.114.84.95
Last change on this file since 422289e was c3df4a6, checked in by Joel Sherrill <joel.sherrill@…>, on 12/06/00 at 15:31:44

2000-12-06 Joel Sherrill <joel@…>

  • src/regiongetinfo.c: Removed unused variable to eliminate warning.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  Region Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
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.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/rtems/status.h>
17#include <rtems/rtems/support.h>
18#include <rtems/score/object.h>
19#include <rtems/rtems/options.h>
20#include <rtems/rtems/region.h>
21#include <rtems/score/states.h>
22#include <rtems/score/thread.h>
23
24/*PAGE
25 *
26 *  rtems_region_get_information
27 *
28 *  This directive will return information about the region specified.
29 *
30 *  Input parameters:
31 *    id         - region id
32 *    the_info   - pointer to region information block
33 *
34 *  Output parameters:
35 *    *the_info   - region information block filled in
36 *    RTEMS_SUCCESSFUL - if successful
37 *    error code - if unsuccessful
38 */
39
40rtems_status_code rtems_region_get_information(
41  Objects_Id              id,
42  Heap_Information_block *the_info
43)
44{
45  register Region_Control *the_region;
46  Objects_Locations        location;
47
48  if ( !the_info )
49    return RTEMS_INVALID_ADDRESS;
50
51  the_region = _Region_Get( id, &location );
52  switch ( location ) {
53    case OBJECTS_REMOTE:        /* this error cannot be returned */
54      return RTEMS_INTERNAL_ERROR;
55
56    case OBJECTS_ERROR:
57      return RTEMS_INVALID_ID;
58
59    case OBJECTS_LOCAL:
60
61      if ( _Heap_Get_information( &the_region->Memory, the_info ) ) {
62        _Thread_Enable_dispatch();
63        return RTEMS_SUCCESSFUL;
64      }
65      _Thread_Enable_dispatch();
66      return RTEMS_INVALID_ADDRESS;
67  }
68
69  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
70}
Note: See TracBrowser for help on using the repository browser.