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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [itron/] [src/] [del_sem.c] - Blame information for rev 219

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

Line No. Rev Author Line
1 30 unneback
/*
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
 *  $Id: del_sem.c,v 1.2 2001-09-27 11:59:13 chris Exp $
10
 */
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
 *  del_sem - Delete Semaphore
20
 *
21
 *  This function implements the ITRON 3.0 del_sem() service.
22
 */
23
 
24
ER del_sem(
25
  ID semid
26
)
27
{
28
  ITRON_Semaphore_Control *the_semaphore;
29
  Objects_Locations        location;
30
 
31
  the_semaphore = _ITRON_Semaphore_Get( semid, &location );
32
  switch ( location ) {
33
    case OBJECTS_REMOTE:               /* Multiprocessing not supported */
34
    case OBJECTS_ERROR:
35
      return _ITRON_Semaphore_Clarify_get_id_error( semid );
36
 
37
    case OBJECTS_LOCAL:
38
      _CORE_semaphore_Flush(
39
        &the_semaphore->semaphore,
40
        NULL,                          /* Multiprocessing not supported */
41
        CORE_SEMAPHORE_WAS_DELETED
42
      );
43
 
44
      _ITRON_Objects_Close(
45
        &_ITRON_Semaphore_Information,
46
        &the_semaphore->Object
47
      );
48
 
49
      _ITRON_Semaphore_Free( the_semaphore );
50
 
51
  /*
52
   *  If multiprocessing were supported, this is where we would announce
53
   *  the destruction of the semaphore to the rest of the system.
54
   */
55
 
56
#if defined(RTEMS_MULTIPROCESSING)
57
#endif
58
 
59
    _Thread_Enable_dispatch();
60
    return E_OK;
61
 
62
  }
63
  return E_OK;
64
}

powered by: WebSVN 2.1.0

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