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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [exec/] [itron/] [src/] [sig_sem.c] - Blame information for rev 208

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

Line No. Rev Author Line
1 158 chris
/*
2
 *  COPYRIGHT (c) 1989-1999.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *
5
 *  The license and distribution terms for this file may be
6
 *  found in the file LICENSE in this distribution or at
7
 *  http://www.OARcorp.com/rtems/license.html.
8
 *
9 208 chris
 *  $Id: sig_sem.c,v 1.2 2001-09-27 11:59:13 chris Exp $
10 158 chris
 */
11
 
12
#include <itron.h>
13
 
14
#include <rtems/itron/semaphore.h>
15
#include <rtems/itron/task.h>
16
#include <rtems/score/tod.h>
17
 
18
/*
19
 *  sig_sem - Signal Semaphore
20
 *
21
 *  This function implements the ITRON 3.0 sig_sem() service.
22
 */
23
 
24
ER sig_sem(
25
  ID semid
26
)
27
{
28
  ITRON_Semaphore_Control *the_semaphore;
29
  Objects_Locations        location;
30
  CORE_semaphore_Status    status;
31
 
32
  the_semaphore = _ITRON_Semaphore_Get( semid, &location );
33
  switch ( location ) {
34
    case OBJECTS_REMOTE:               /* Multiprocessing not supported */
35
    case OBJECTS_ERROR:
36
      return _ITRON_Semaphore_Clarify_get_id_error( semid );
37
 
38
    case OBJECTS_LOCAL:
39
      /*
40
       *  XXX maxsemcnt
41
       */
42
 
43
      status = _CORE_semaphore_Surrender(
44
        &the_semaphore->semaphore,
45
        the_semaphore->Object.id,
46
        NULL                       /* Multiprocessing not supported */
47
      );
48
      _Thread_Enable_dispatch();
49
      return _ITRON_Semaphore_Translate_core_semaphore_return_code( status );
50
  }
51
  return E_OK;
52
}

powered by: WebSVN 2.1.0

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