RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
include
rtems
rfs
rtems-rfs-mutex.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
15
16
/*
17
* COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
18
*
19
* Redistribution and use in source and binary forms, with or without
20
* modification, are permitted provided that the following conditions
21
* are met:
22
* 1. Redistributions of source code must retain the above copyright
23
* notice, this list of conditions and the following disclaimer.
24
* 2. Redistributions in binary form must reproduce the above copyright
25
* notice, this list of conditions and the following disclaimer in the
26
* documentation and/or other materials provided with the distribution.
27
*
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
* POSSIBILITY OF SUCH DAMAGE.
39
*/
40
41
#if !defined (_RTEMS_RFS_MUTEX_H_)
42
#define _RTEMS_RFS_MUTEX_H_
43
44
#include <errno.h>
45
46
#include <
rtems/rfs/rtems-rfs-trace.h
>
47
48
#if __rtems__
49
#include <
rtems.h
>
50
#include <
rtems/error.h
>
51
#include <
rtems/thread.h
>
52
#endif
53
57
#if __rtems__
58
typedef
rtems_recursive_mutex
rtems_rfs_mutex
;
59
#else
60
typedef
uint32_t
rtems_rfs_mutex
;
/* place holder */
61
#endif
62
72
int
rtems_rfs_mutex_create
(
rtems_rfs_mutex
*
mutex
);
73
82
int
rtems_rfs_mutex_destroy
(
rtems_rfs_mutex
*
mutex
);
83
92
static
inline
int
93
rtems_rfs_mutex_lock (
rtems_rfs_mutex
*
mutex
)
94
{
95
#if __rtems__
96
rtems_recursive_mutex_lock(
mutex
);
97
#endif
98
return
0;
99
}
100
109
static
inline
int
110
rtems_rfs_mutex_unlock (
rtems_rfs_mutex
*
mutex
)
111
{
112
#if __rtems__
113
rtems_recursive_mutex_unlock(
mutex
);
114
#endif
115
return
0;
116
}
117
118
#endif
error.h
RTEMS Error Reporting.
rtems_rfs_mutex_create
int rtems_rfs_mutex_create(rtems_rfs_mutex *mutex)
Create the mutex.
Definition
rtems-rfs-mutex.c:42
rtems_rfs_mutex
uint32_t rtems_rfs_mutex
Definition
rtems-rfs-mutex.h:60
rtems_rfs_mutex_destroy
int rtems_rfs_mutex_destroy(rtems_rfs_mutex *mutex)
Destroy the mutex.
Definition
rtems-rfs-mutex.c:51
rtems-rfs-trace.h
Manages the Trace and Debugging Features of the RTEMS RFS File System.
rtems.h
This header file defines the RTEMS Classic API.
mutex
Definition
mutex.h:4
thread.h
This header file provides the API of Self-Contained Objects.
Generated by
1.18.0