blob: 3c6f617861652bbf0fecc61643410c89b45b20eb (
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
|
/*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <rtems/system.h>
#include <rtems/score/coremutex.h>
#include <rtems/score/watchdog.h>
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h>
#endif
#include <rtems/posix/mutex.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
/*PAGE
*
* _POSIX_Mutex_From_core_mutex_status
*/
int _POSIX_Mutex_From_core_mutex_status(
CORE_mutex_Status status
)
{
switch ( status ) {
case CORE_MUTEX_STATUS_SUCCESSFUL:
return 0;
case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
return EBUSY;
case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
return EDEADLK;
case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
return EPERM;
case CORE_MUTEX_WAS_DELETED:
return EINVAL;
case CORE_MUTEX_TIMEOUT:
return EAGAIN;
case CORE_MUTEX_STATUS_CEILING_VIOLATED:
return EINVAL;
default:
break;
}
assert( 0 );
return 0;
}
|