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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 30 unneback
/*
2
 *  ITRON 3.0 Mailbox Manager
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 *  $Id: del_mbx.c,v 1.2 2001-09-27 11:59:13 chris Exp $
12
 */
13
 
14
#include <itron.h>
15
 
16
#include <rtems/itron/mbox.h>
17
#include <rtems/itron/task.h>
18
 
19
/*
20
 *  del_mbx - Delete Mailbox
21
 *
22
 *
23
 * ------Parameters--------------
24
 * ID mbxid      The Mailbox's ID
25
 * ------------------------------
26
 *
27
 * -----Return Parameters-------
28
 * ER ercd       Itron Error Code
29
 * -----------------------------
30
 *
31
 * -----C Language Interface----
32
 * ER ercd = del_mbx(ID mbxid);
33
 * -----------------------------
34
 *
35
 */
36
 
37
ER del_mbx(
38
  ID mbxid
39
)
40
{
41
  register ITRON_Mailbox_Control *the_mailbox;
42
  Objects_Locations               location;
43
 
44
  the_mailbox= _ITRON_Mailbox_Get( mbxid, &location );
45
  switch ( location ) {
46
    case OBJECTS_ERROR:
47
    case OBJECTS_REMOTE:
48
      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
49
 
50
    case OBJECTS_LOCAL:
51
      _Objects_Close( &_ITRON_Mailbox_Information, &the_mailbox->Object );
52
 
53
      _CORE_message_queue_Close(
54
        &the_mailbox->message_queue,
55
        NULL,                      /* Multiprocessing not supported */
56
        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
57
      );
58
 
59
      _ITRON_Mailbox_Free(the_mailbox);
60
      break;
61
  }
62
 
63
  _ITRON_return_errorno( E_OK );
64
}

powered by: WebSVN 2.1.0

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