source: rtems/c/src/lib/libbsp/shmdr/receive.c @ 8c99365

Last change on this file since 8c99365 was 8c99365, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:36 PM

2003-09-04 Joel Sherrill <joel@…>

  • addlq.c, cnvpkt.c, dump.c, fatal.c, getlq.c, getpkt.c, init.c, initlq.c, intr.c, mpci.h, mpisr.c, poll.c, receive.c, retpkt.c, send.c, setckvec.c, shm_driver.h: URL for license changed.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*  Shm_Receive_packet
2 *
3 *  This routine is the shared memory locked queue MPCI driver routine
4 *  used to obtain a packet containing a message from this node's
5 *  receive queue.
6 *
7 *  Input parameters:
8 *    packet         - address of a pointer to a packet
9 *
10 *  Output parameters:
11 *    *(rpb->packet) - pointer to packet
12 *                     NULL if no packet currently available
13 *
14 *  COPYRIGHT (c) 1989-1999.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#include <rtems.h>
25#include "shm_driver.h"
26
27rtems_mpci_entry Shm_Receive_packet(
28  rtems_packet_prefix **packet
29)
30{
31  Shm_Envelope_control *ecb;
32
33  ecb = Shm_Locked_queue_Get( Shm_Local_receive_queue );
34  if ( ecb ) {
35    *(packet) = Shm_Envelope_control_to_packet_prefix_pointer( ecb );
36    if ( ecb->Preamble.endian != Shm_Configuration->format )
37      Shm_Convert_packet( *packet );
38    Shm_Receive_message_count++;
39  } else {
40    *(packet) = NULL;
41    Shm_Null_message_count++;
42  }
43}
Note: See TracBrowser for help on using the repository browser.