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

Subversion Repositories openrisc

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

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: snd_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
 *  snd_msg - Send Message to Mailbox
21
 */
22
 
23
ER snd_msg(
24
  ID     mbxid,
25
  T_MSG *pk_msg
26
)
27
{
28
  register ITRON_Mailbox_Control *the_mailbox;
29
  Objects_Locations                location;
30
  unsigned32                       message_priority;
31
  void                            *message_contents;
32
 
33
  if ( !pk_msg )
34
    return E_PAR;
35
 
36
  the_mailbox = _ITRON_Mailbox_Get( mbxid, &location );
37
  switch ( location ) {
38
    case OBJECTS_REMOTE:
39
    case OBJECTS_ERROR:
40
      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
41
 
42
    case OBJECTS_LOCAL:
43
      if ( the_mailbox->do_message_priority )
44
        message_priority = pk_msg->msgpri;
45
      else
46
        message_priority = CORE_MESSAGE_QUEUE_SEND_REQUEST;
47
 
48
      message_contents = pk_msg;
49
      _CORE_message_queue_Submit(
50
        &the_mailbox->message_queue,
51
        &message_contents,
52
        sizeof(T_MSG *),
53
        the_mailbox->Object.id,
54
        NULL,          /* multiprocessing not supported */
55
        message_priority,
56
        FALSE,     /* do not allow sender to block */
57
 
58
     );
59
     break;
60
  }
61
 
62
  _ITRON_return_errorno(
63
     _ITRON_Mailbox_Translate_core_message_queue_return_code(
64
          _Thread_Executing->Wait.return_code
65
     )
66
  );
67
}

powered by: WebSVN 2.1.0

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