source: rtems/c/src/libchip/shmdr/receive.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • 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.org/license/LICENSE.
20 */
21
22#include <rtems.h>
23#include "shm_driver.h"
24
25rtems_mpci_entry Shm_Receive_packet(
26  rtems_packet_prefix **packet
27)
28{
29  Shm_Envelope_control *ecb;
30
31  ecb = Shm_Locked_queue_Get( Shm_Local_receive_queue );
32  if ( ecb ) {
33    *(packet) = Shm_Envelope_control_to_packet_prefix_pointer( ecb );
34    if ( ecb->Preamble.endian != Shm_Configuration->format )
35      Shm_Convert_packet( *packet );
36    Shm_Receive_message_count++;
37  } else {
38    *(packet) = NULL;
39    Shm_Null_message_count++;
40  }
41}
Note: See TracBrowser for help on using the repository browser.