5
Last change
on this file since 66cb142 was
0a00b2b,
checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 11:24:11
|
rtems: Remove location from _Partition_Get()
Use _Objects_Get_local() for _Partition_Get() to get rid of the location
parameter. Move remote object handling to partition MPCI support.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * Partition Manager |
---|
3 | * |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-2014. |
---|
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.rtems.org/license/LICENSE. |
---|
11 | */ |
---|
12 | |
---|
13 | #if HAVE_CONFIG_H |
---|
14 | #include "config.h" |
---|
15 | #endif |
---|
16 | |
---|
17 | #include <rtems/rtems/partimpl.h> |
---|
18 | |
---|
19 | rtems_status_code rtems_partition_return_buffer( |
---|
20 | rtems_id id, |
---|
21 | void *buffer |
---|
22 | ) |
---|
23 | { |
---|
24 | Partition_Control *the_partition; |
---|
25 | ISR_lock_Context lock_context; |
---|
26 | |
---|
27 | the_partition = _Partition_Get( id, &lock_context ); |
---|
28 | |
---|
29 | if ( the_partition == NULL ) { |
---|
30 | #if defined(RTEMS_MULTIPROCESSING) |
---|
31 | return _Partition_MP_Return_buffer( id, buffer ); |
---|
32 | #else |
---|
33 | return RTEMS_INVALID_ID; |
---|
34 | #endif |
---|
35 | } |
---|
36 | |
---|
37 | _Partition_Acquire_critical( the_partition, &lock_context ); |
---|
38 | |
---|
39 | if ( !_Partition_Is_buffer_valid( buffer, the_partition ) ) { |
---|
40 | _Partition_Release( the_partition, &lock_context ); |
---|
41 | return RTEMS_INVALID_ADDRESS; |
---|
42 | } |
---|
43 | |
---|
44 | _Partition_Free_buffer( the_partition, buffer ); |
---|
45 | the_partition->number_of_used_blocks -= 1; |
---|
46 | _Partition_Release( the_partition, &lock_context ); |
---|
47 | return RTEMS_SUCCESSFUL; |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.