source: rtems/cpukit/rtems/src/regiongetinfo.c @ 66cb142

Last change on this file since 66cb142 was 1142f55, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 8, 2016 at 4:56:46 AM

rtems: Add and use _Region_Get_and_lock()

Get region and lock allocator in _Region_Get_and_lock() in case the
region exists and unlock it in _Region_Unlock().

  • Property mode set to 100644
File size: 867 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Get Region Information
5 *  @ingroup ClassicRegion
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2014.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/regionimpl.h>
22
23rtems_status_code rtems_region_get_information(
24  rtems_id                id,
25  Heap_Information_block *the_info
26)
27{
28  Region_Control *the_region;
29
30  if ( the_info == NULL ) {
31    return RTEMS_INVALID_ADDRESS;
32  }
33
34  the_region = _Region_Get_and_lock( id );
35
36  if ( the_region == NULL ) {
37    return RTEMS_INVALID_ID;
38  }
39
40  _Heap_Get_information( &the_region->Memory, the_info );
41
42  _Region_Unlock( the_region );
43  return RTEMS_SUCCESSFUL;
44}
Note: See TracBrowser for help on using the repository browser.