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

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 1.2 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, 1990, 1991, 1992, 1993, 1994.
15 *  On-Line Applications Research Corporation (OAR).
16 *  All rights assigned to U.S. Government, 1994.
17 *
18 *  This material may be reproduced by or for the U.S. Government pursuant
19 *  to the copyright license under the clause at DFARS 252.227-7013.  This
20 *  notice must appear in all copies of this file and its derivatives.
21 *
22 *  $Id$
23 */
24
25#include <rtems.h>
26#include "shm.h"
27
28rtems_mpci_entry Shm_Receive_packet(
29  rtems_packet_prefix **packet
30)
31{
32  Shm_Envelope_control *ecb;
33
34  ecb = Shm_Locked_queue_Get( Shm_Local_receive_queue );
35  if ( ecb ) {
36    *(packet) = Shm_Envelope_control_to_packet_prefix_pointer( ecb );
37    if ( ecb->Preamble.endian != Shm_Configuration->format )
38      Shm_Convert_packet( *packet );
39    Shm_Receive_message_count++;
40  } else {
41    *(packet) = NULL;
42    Shm_Null_message_count++;
43  }
44}
Note: See TracBrowser for help on using the repository browser.