source: rtems/cpukit/rtems/src/regionextend.c @ 6b5f22dc

Last change on this file since 6b5f22dc was 6b5f22dc, checked in by Sebastian Huber <sebastian.huber@…>, on 11/26/20 at 10:45:47

rtems: Canonicalize Doxygen @file comments

Use common phrases for the file brief descriptions.

Update #3706.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSImplClassicRegion
5 *
6 * @brief This source file contains the implementation of
7 *   rtems_region_extend().
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2009.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <rtems/rtems/regionimpl.h>
24
25rtems_status_code rtems_region_extend(
26  rtems_id   id,
27  void      *starting_address,
28  uintptr_t  length
29)
30{
31  rtems_status_code  status;
32  Region_Control    *the_region;
33  uintptr_t          amount_extended;
34
35  if ( starting_address == NULL ) {
36    return RTEMS_INVALID_ADDRESS;
37  }
38
39  the_region = _Region_Get_and_lock( id );
40
41  if ( the_region == NULL ) {
42    return RTEMS_INVALID_ID;
43  }
44
45  amount_extended = _Heap_Extend(
46    &the_region->Memory,
47    starting_address,
48    length,
49    0
50  );
51
52  if ( amount_extended > 0 ) {
53    the_region->maximum_segment_size += amount_extended;
54    status = RTEMS_SUCCESSFUL;
55  } else {
56    status = RTEMS_INVALID_ADDRESS;
57  }
58
59  _Region_Unlock( the_region );
60  return status;
61}
Note: See TracBrowser for help on using the repository browser.