source: rtems/cpukit/libfs/src/rfs/rtems-rfs-mutex.c @ 3c96bee

4.115
Last change on this file since 3c96bee was ff1becb, checked in by Joel Sherrill <joel.sherrill@…>, on 01/10/13 at 19:22:57

rfs: Doxygen group cannot have a dash in it

Change rtems-rfs to rtems_rfs

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 * @file
3 *
4 * @brief RTEMS File System Mutex
5 * @ingroup rtems_rfs
6 */
7/*
8 *  COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
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.com/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/rfs/rtems-rfs-mutex.h>
20
21#if __rtems__
22/**
23 * RTEMS_RFS Mutex Attributes
24 */
25#define RTEMS_RFS_MUTEX_ATTRIBS \
26  (RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | \
27   RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
28#endif
29
30int
31rtems_rfs_mutex_create (rtems_rfs_mutex* mutex)
32{
33#if __rtems__
34  rtems_status_code sc;
35  sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
36                               1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
37                               mutex);
38  if (sc != RTEMS_SUCCESSFUL)
39  {
40    if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
41      printf ("rtems-rfs: mutex: open failed: %s\n",
42              rtems_status_text (sc));
43    return EIO;
44  }
45#endif
46  return 0;
47}
48
49int
50rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
51{
52#if __rtems__
53  rtems_status_code sc;
54  sc = rtems_semaphore_delete (*mutex);
55  if (sc != RTEMS_SUCCESSFUL)
56  {
57    if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
58      printf ("rtems-rfs: mutex: close failed: %s\n",
59              rtems_status_text (sc));
60    return EIO;
61  }
62#endif
63  return 0;
64}
Note: See TracBrowser for help on using the repository browser.