Last change
on this file since 9278f3d 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 RTEMSImplClassicDPMem |
---|
5 | * |
---|
6 | * @brief This source file contains the implementation of |
---|
7 | * rtems_port_external_to_internal(). |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * COPYRIGHT (c) 1989-2014. |
---|
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/dpmemimpl.h> |
---|
24 | #include <rtems/score/address.h> |
---|
25 | |
---|
26 | rtems_status_code rtems_port_external_to_internal( |
---|
27 | rtems_id id, |
---|
28 | void *external, |
---|
29 | void **internal |
---|
30 | ) |
---|
31 | { |
---|
32 | Dual_ported_memory_Control *the_port; |
---|
33 | ISR_lock_Context lock_context; |
---|
34 | uintptr_t length; |
---|
35 | |
---|
36 | if ( internal == NULL ) { |
---|
37 | return RTEMS_INVALID_ADDRESS; |
---|
38 | } |
---|
39 | |
---|
40 | the_port = _Dual_ported_memory_Get( id, &lock_context ); |
---|
41 | |
---|
42 | if ( the_port == NULL ) { |
---|
43 | return RTEMS_INVALID_ID; |
---|
44 | } |
---|
45 | |
---|
46 | length = (uintptr_t) _Addresses_Subtract( external, the_port->external_base ); |
---|
47 | |
---|
48 | if ( length > the_port->length ) { |
---|
49 | *internal = external; |
---|
50 | } else { |
---|
51 | *internal = _Addresses_Add_offset( the_port->internal_base, length ); |
---|
52 | } |
---|
53 | |
---|
54 | _ISR_lock_ISR_enable( &lock_context ); |
---|
55 | return RTEMS_SUCCESSFUL; |
---|
56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.