source: rtems/cpukit/itron/src/snd_mbx.c @ 5e96e917

4.104.114.84.95
Last change on this file since 5e96e917 was 5e96e917, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 15:24:11

Updated Mailbox Manager submitted and split into multiple files.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  ITRON 3.0 Mailbox Manager
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.OARcorp.com/rtems/license.html.
7 *
8 *  $Id$
9 */
10
11#include <itron.h>
12
13#include <rtems/itron/mbox.h>
14#include <rtems/itron/task.h>
15
16/*
17 *  snd_msg - Send Message to Mailbox
18 */
19
20ER snd_msg(
21  ID     mbxid,
22  T_MSG *pk_msg
23)
24{
25  register ITRON_Mailbox_Control *the_mailbox;
26  Objects_Locations                location;
27  CORE_message_queue_Status        status = E_OK;
28  unsigned32                       message_priority;
29  void                            *message_contents;
30
31  if ( !pk_msg )
32    return E_PAR;
33
34  the_mailbox = _ITRON_Mailbox_Get( mbxid, &location );
35  switch ( location ) {
36    case OBJECTS_REMOTE:
37    case OBJECTS_ERROR:
38      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
39
40    case OBJECTS_LOCAL:
41      if ( the_mailbox->do_message_priority )
42        message_priority = pk_msg->msgpri;
43      else
44        message_priority = CORE_MESSAGE_QUEUE_SEND_REQUEST;
45
46      message_contents = pk_msg;
47      status = _CORE_message_queue_Submit(
48        &the_mailbox->message_queue,
49        &message_contents,
50        sizeof(T_MSG *),
51        the_mailbox->Object.id,
52        NULL,          /* multiprocessing not supported */
53        message_priority
54     );
55     break;
56  }
57
58  _ITRON_return_errorno(
59     _ITRON_Mailbox_Translate_core_message_queue_return_code(status) );
60}
Note: See TracBrowser for help on using the repository browser.