5
Last change
on this file since d78d529 was
60a23875,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/08/16 at 06:13:49
|
rtems: Delete Region_Control::length
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Extend Region |
---|
5 | * @ingroup ClassicRegion |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2009. |
---|
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 | |
---|
23 | rtems_status_code rtems_region_extend( |
---|
24 | rtems_id id, |
---|
25 | void *starting_address, |
---|
26 | uintptr_t length |
---|
27 | ) |
---|
28 | { |
---|
29 | rtems_status_code status; |
---|
30 | Region_Control *the_region; |
---|
31 | uintptr_t amount_extended; |
---|
32 | |
---|
33 | if ( starting_address == NULL ) { |
---|
34 | return RTEMS_INVALID_ADDRESS; |
---|
35 | } |
---|
36 | |
---|
37 | the_region = _Region_Get_and_lock( id ); |
---|
38 | |
---|
39 | if ( the_region == NULL ) { |
---|
40 | return RTEMS_INVALID_ID; |
---|
41 | } |
---|
42 | |
---|
43 | amount_extended = _Heap_Extend( |
---|
44 | &the_region->Memory, |
---|
45 | starting_address, |
---|
46 | length, |
---|
47 | 0 |
---|
48 | ); |
---|
49 | |
---|
50 | if ( amount_extended > 0 ) { |
---|
51 | the_region->maximum_segment_size += amount_extended; |
---|
52 | status = RTEMS_SUCCESSFUL; |
---|
53 | } else { |
---|
54 | status = RTEMS_INVALID_ADDRESS; |
---|
55 | } |
---|
56 | |
---|
57 | _Region_Unlock( the_region ); |
---|
58 | return status; |
---|
59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.