source: rtems/cpukit/score/src/smplock.c @ 2548d14

5
Last change on this file since 2548d14 was 3d35bc0, checked in by Sebastian Huber <sebastian.huber@…>, on 01/11/17 at 12:41:55

score: Improve SMP lock debug support

The CPU index starts with zero. Increment it by one, to allow global
SMP locks to reside in the BSS section.

  • Property mode set to 100644
File size: 1.5 KB
Line 
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)
22void _SMP_lock_Initialize(
23  SMP_lock_Control *lock,
24  const char *name
25)
26{
27  _SMP_lock_Initialize_inline( lock, name );
28}
29
30void _SMP_lock_Destroy( SMP_lock_Control *lock )
31{
32  _SMP_lock_Destroy_inline( lock );
33}
34#endif
35
36void _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)
45void _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
54void _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)
63void _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)
73bool _SMP_lock_Is_owner( const SMP_lock_Control *lock )
74{
75  return lock->owner == _SMP_lock_Who_am_I();
76}
77#endif
Note: See TracBrowser for help on using the repository browser.