1 | /* |
---|
2 | * Copyright (c) 2015, 2016 embedded brains GmbH. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Dornierstr. 4 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <rtems@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.org/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #if HAVE_CONFIG_H |
---|
16 | #include "config.h" |
---|
17 | #endif |
---|
18 | |
---|
19 | #include <rtems/score/smplock.h> |
---|
20 | |
---|
21 | #if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE) |
---|
22 | void _SMP_lock_Initialize( |
---|
23 | SMP_lock_Control *lock, |
---|
24 | const char *name |
---|
25 | ) |
---|
26 | { |
---|
27 | _SMP_lock_Initialize_inline( lock, name ); |
---|
28 | } |
---|
29 | |
---|
30 | void _SMP_lock_Destroy( SMP_lock_Control *lock ) |
---|
31 | { |
---|
32 | _SMP_lock_Destroy_inline( lock ); |
---|
33 | } |
---|
34 | #endif |
---|
35 | |
---|
36 | void _SMP_lock_Acquire( |
---|
37 | SMP_lock_Control *lock, |
---|
38 | SMP_lock_Context *context |
---|
39 | ) |
---|
40 | { |
---|
41 | _SMP_lock_Acquire_inline( lock, context ); |
---|
42 | } |
---|
43 | |
---|
44 | #if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE) |
---|
45 | void _SMP_lock_Release( |
---|
46 | SMP_lock_Control *lock, |
---|
47 | SMP_lock_Context *context |
---|
48 | ) |
---|
49 | { |
---|
50 | _SMP_lock_Release_inline( lock, context ); |
---|
51 | } |
---|
52 | #endif |
---|
53 | |
---|
54 | void _SMP_lock_ISR_disable_and_acquire( |
---|
55 | SMP_lock_Control *lock, |
---|
56 | SMP_lock_Context *context |
---|
57 | ) |
---|
58 | { |
---|
59 | _SMP_lock_ISR_disable_and_acquire_inline( lock, context ); |
---|
60 | } |
---|
61 | |
---|
62 | #if defined(RTEMS_SMP_LOCK_DO_NOT_INLINE) |
---|
63 | void _SMP_lock_Release_and_ISR_enable( |
---|
64 | SMP_lock_Control *lock, |
---|
65 | SMP_lock_Context *context |
---|
66 | ) |
---|
67 | { |
---|
68 | _SMP_lock_Release_and_ISR_enable_inline( lock, context ); |
---|
69 | } |
---|
70 | #endif |
---|
71 | |
---|
72 | #if defined(RTEMS_DEBUG) |
---|
73 | bool _SMP_lock_Is_owner( const SMP_lock_Control *lock ) |
---|
74 | { |
---|
75 | return lock->owner == _SMP_lock_Who_am_I(); |
---|
76 | } |
---|
77 | #endif |
---|