4.104.114.84.95
Last change
on this file since fb27af76 was
fb27af76,
checked in by Joel Sherrill <joel.sherrill@…>, on 11/15/99 at 16:39:01
|
Split ITRON semaphore manager into multiple files.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[fb27af76] | 1 | /* |
---|
| 2 | * The license and distribution terms for this file may be |
---|
| 3 | * found in the file LICENSE in this distribution or at |
---|
| 4 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 5 | * |
---|
| 6 | * $Id$ |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include <itron.h> |
---|
| 10 | |
---|
| 11 | #include <rtems/itron/semaphore.h> |
---|
| 12 | #include <rtems/itron/task.h> |
---|
| 13 | #include <rtems/score/tod.h> |
---|
| 14 | |
---|
| 15 | /* |
---|
| 16 | * del_sem - Delete Semaphore |
---|
| 17 | * |
---|
| 18 | * This function implements the ITRON 3.0 del_sem() service. |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | ER del_sem( |
---|
| 22 | ID semid |
---|
| 23 | ) |
---|
| 24 | { |
---|
| 25 | ITRON_Semaphore_Control *the_semaphore; |
---|
| 26 | Objects_Locations location; |
---|
| 27 | |
---|
| 28 | the_semaphore = _ITRON_Semaphore_Get( semid, &location ); |
---|
| 29 | switch ( location ) { |
---|
| 30 | case OBJECTS_REMOTE: /* Multiprocessing not supported */ |
---|
| 31 | case OBJECTS_ERROR: |
---|
| 32 | return _ITRON_Semaphore_Clarify_get_id_error( semid ); |
---|
| 33 | |
---|
| 34 | case OBJECTS_LOCAL: |
---|
| 35 | _CORE_semaphore_Flush( |
---|
| 36 | &the_semaphore->semaphore, |
---|
| 37 | NULL, /* Multiprocessing not supported */ |
---|
| 38 | CORE_SEMAPHORE_WAS_DELETED |
---|
| 39 | ); |
---|
| 40 | |
---|
| 41 | _ITRON_Objects_Close( |
---|
| 42 | &_ITRON_Semaphore_Information, |
---|
| 43 | &the_semaphore->Object |
---|
| 44 | ); |
---|
| 45 | |
---|
| 46 | _ITRON_Semaphore_Free( the_semaphore ); |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | * If multiprocessing were supported, this is where we would announce |
---|
| 50 | * the destruction of the semaphore to the rest of the system. |
---|
| 51 | */ |
---|
| 52 | |
---|
| 53 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | _Thread_Enable_dispatch(); |
---|
| 57 | return E_OK; |
---|
| 58 | |
---|
| 59 | } |
---|
| 60 | return E_OK; |
---|
| 61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.