source: rtems/cpukit/rtems/src/regiongetfreeinfo.c @ 80cf60e

5
Last change on this file since 80cf60e was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32

Canonicalize config.h include

Use the following variant which was already used by most source files:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

  • Property mode set to 100644
File size: 971 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Get Region Free 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#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/regionimpl.h>
22
23#include <string.h>
24
25rtems_status_code rtems_region_get_free_information(
26  rtems_id                id,
27  Heap_Information_block *the_info
28)
29{
30  Region_Control *the_region;
31
32  if ( the_info == NULL ) {
33    return RTEMS_INVALID_ADDRESS;
34  }
35
36  the_region = _Region_Get_and_lock( id );
37
38  if ( the_region == NULL ) {
39    return RTEMS_INVALID_ID;
40  }
41
42  memset( &the_info->Used, 0, sizeof( the_info->Used ) );
43  _Heap_Get_free_information( &the_region->Memory, &the_info->Free );
44
45  _Region_Unlock( the_region );
46  return RTEMS_SUCCESSFUL;
47}
Note: See TracBrowser for help on using the repository browser.