source: rtems/c/src/exec/itron/src/snd_mbx.c @ f42b726

4.104.114.84.95
Last change on this file since f42b726 was f42b726, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/01 at 14:17:28

2001-01-24 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/config.h
  • src/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/.cvsignore: Add config.h and stamp-h
  • src/*.c: Add config.h support.
  • Property mode set to 100644
File size: 1.6 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#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <itron.h>
19
20#include <rtems/itron/mbox.h>
21#include <rtems/itron/task.h>
22
23/*
24 *  snd_msg - Send Message to Mailbox
25 */
26
27ER snd_msg(
28  ID     mbxid,
29  T_MSG *pk_msg
30)
31{
32  register ITRON_Mailbox_Control *the_mailbox;
33  Objects_Locations                location;
34  unsigned32                       message_priority;
35  void                            *message_contents;
36
37  if ( !pk_msg )
38    return E_PAR;
39
40  the_mailbox = _ITRON_Mailbox_Get( mbxid, &location );
41  switch ( location ) {
42    case OBJECTS_REMOTE:
43    case OBJECTS_ERROR:
44      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
45
46    case OBJECTS_LOCAL:
47      if ( the_mailbox->do_message_priority )
48        message_priority = pk_msg->msgpri;
49      else
50        message_priority = CORE_MESSAGE_QUEUE_SEND_REQUEST;
51
52      message_contents = pk_msg;
53      _CORE_message_queue_Submit(
54        &the_mailbox->message_queue,
55        &message_contents,
56        sizeof(T_MSG *),
57        the_mailbox->Object.id,
58        NULL,          /* multiprocessing not supported */
59        message_priority,
60        FALSE,     /* do not allow sender to block */
61        0          /* no timeout */
62     );
63     break;
64  }
65
66  _ITRON_return_errorno(
67     _ITRON_Mailbox_Translate_core_message_queue_return_code(
68          _Thread_Executing->Wait.return_code
69     )
70  );
71}
Note: See TracBrowser for help on using the repository browser.