OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [mutexfromcorestatus.c] - Blame information for rev 773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: mutexfromcorestatus.c,v 1.2 2001-09-27 11:59:17 chris Exp $
3
 */
4
 
5
#include <assert.h>
6
#include <errno.h>
7
#include <pthread.h>
8
 
9
#include <rtems/system.h>
10
#include <rtems/score/coremutex.h>
11
#include <rtems/score/watchdog.h>
12
#if defined(RTEMS_MULTIPROCESSING)
13
#include <rtems/score/mpci.h>
14
#endif
15
#include <rtems/posix/mutex.h>
16
#include <rtems/posix/priority.h>
17
#include <rtems/posix/time.h>
18
 
19
/*PAGE
20
 *
21
 *  _POSIX_Mutex_From_core_mutex_status
22
 */
23
 
24
int _POSIX_Mutex_From_core_mutex_status(
25
  CORE_mutex_Status  status
26
)
27
{
28
  switch ( status ) {
29
    case CORE_MUTEX_STATUS_SUCCESSFUL:
30
      return 0;
31
    case CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT:
32
      return EBUSY;
33
    case CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED:
34
      return EDEADLK;
35
    case CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE:
36
      return EPERM;
37
    case CORE_MUTEX_WAS_DELETED:
38
      return EINVAL;
39
    case CORE_MUTEX_TIMEOUT:
40
      return EAGAIN;
41
    case CORE_MUTEX_STATUS_CEILING_VIOLATED:
42
      return EINVAL;
43
    default:
44
      break;
45
  }
46
  assert( 0 );
47
  return 0;
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.