blob: a20d9260a4944d602d6f0d3b67241041c82c641f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
/**
* @file rtems/score/smplock.h
*
* This include file defines the interface for atomic locks
* which can be used in multiprocessor configurations.
*/
/*
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#ifndef _RTEMS_LOCK_H
#define _RTEMS_LOCK_H
#include <rtems/score/isr.h>
/**
* @defgroup RTEMS Lock Interface
*
*/
/**@{*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* This type is used to lock elements for atomic access.
*
* @note This type may move to RTEMS.
*/
typedef volatile uint32_t SMP_lock_Control;
/**
* @brief Initialize a Lock
*
* This method is used to initialize the lock at @a lock.
*
* @param [in] lock is the address of the lock to obtain.
*
* @note This lock may be "too low" here. It may need to move
* out of the BSP area.
*/
void _SMP_lock_Spinlock_Initialize(
SMP_lock_Control *lock
);
/**
* @brief Obtain a Lock
*
* This method is used to obtain the lock at @a lock.
*
* @param [in] lock is the address of the lock to obtain.
*
* @return This method returns with processor interrupts disabled.
* The previous level is returned.
*
* @note This lock may be "too low" here. It may need to move
* out of the BSP area.
*/
ISR_Level _SMP_lock_Spinlock_Obtain(
SMP_lock_Control *lock
);
/**
* @brief Release a Lock
*
* This method is used to release the lock at @a lock.
*
* @param [in] lock is the address of the lock to obtain.
*
* @note This lock may be "too low" here. It may need to move
* out of the BSP area.
*/
void _SMP_lock_Spinlock_Release(
SMP_lock_Control *lock,
ISR_Level level
);
#ifdef __cplusplus
}
#endif
/**@}*/
#endif
/* end of include file */
|