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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [shmdr/] [receive.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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.OARcorp.com/rtems/license.html.
20
 *
21
 *  receive.c,v 1.8 1999/11/30 19:57:59 joel Exp
22
 */
23
 
24
#include <rtems.h>
25
#include "shm_driver.h"
26
 
27
rtems_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
}

powered by: WebSVN 2.1.0

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