source: rtems/c/src/exec/itron/src/snd_mbx.c @ 9d9a3dd

4.104.114.84.95
Last change on this file since 9d9a3dd was 9d9a3dd, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/17/99 at 16:47:58

+ Updated copyright information.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
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$
12 */
13
14#include <itron.h>
15
16#include <rtems/itron/mbox.h>
17#include <rtems/itron/task.h>
18
19/*
20 *  snd_msg - Send Message to Mailbox
21 */
22
23ER snd_msg(
24  ID     mbxid,
25  T_MSG *pk_msg
26)
27{
28  register ITRON_Mailbox_Control *the_mailbox;
29  Objects_Locations                location;
30  CORE_message_queue_Status        status = E_OK;
31  unsigned32                       message_priority;
32  void                            *message_contents;
33
34  if ( !pk_msg )
35    return E_PAR;
36
37  the_mailbox = _ITRON_Mailbox_Get( mbxid, &location );
38  switch ( location ) {
39    case OBJECTS_REMOTE:
40    case OBJECTS_ERROR:
41      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
42
43    case OBJECTS_LOCAL:
44      if ( the_mailbox->do_message_priority )
45        message_priority = pk_msg->msgpri;
46      else
47        message_priority = CORE_MESSAGE_QUEUE_SEND_REQUEST;
48
49      message_contents = pk_msg;
50      status = _CORE_message_queue_Submit(
51        &the_mailbox->message_queue,
52        &message_contents,
53        sizeof(T_MSG *),
54        the_mailbox->Object.id,
55        NULL,          /* multiprocessing not supported */
56        message_priority
57     );
58     break;
59  }
60
61  _ITRON_return_errorno(
62     _ITRON_Mailbox_Translate_core_message_queue_return_code(status) );
63}
Note: See TracBrowser for help on using the repository browser.