source: rtems/c/src/libchip/shmdr/addlq.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/*  void Shm_Locked_queue_Add( lq_cb, ecb )
2 *
3 *  This routine adds an envelope control block to a shared memory queue.
4 *
5 *  Input parameters:
6 *    lq_cb - pointer to a locked queue control block
7 *    ecb   - pointer to an envelope control block
8 *
9 *  Output parameters: NONE
10 *
11 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
12 *  On-Line Applications Research Corporation (OAR).
13 *  All rights assigned to U.S. Government, 1994.
14 *
15 *  This material may be reproduced by or for the U.S. Government pursuant
16 *  to the copyright license under the clause at DFARS 252.227-7013.  This
17 *  notice must appear in all copies of this file and its derivatives.
18 *
19 *  $Id$
20 */
21
22#include <rtems.h>
23#include "shm.h"
24
25void Shm_Locked_queue_Add(
26  Shm_Locked_queue_Control *lq_cb,
27  Shm_Envelope_control     *ecb
28)
29{
30  rtems_unsigned32 index;
31
32  ecb->next  = Shm_Locked_queue_End_of_list;
33  ecb->queue = lq_cb->owner;
34  index      = ecb->index;
35
36  Shm_Lock( lq_cb );
37    if ( Shm_Convert(lq_cb->front) != Shm_Locked_queue_End_of_list )
38      Shm_Envelopes[ Shm_Convert(lq_cb->rear) ].next = index;
39    else
40      lq_cb->front = index;
41    lq_cb->rear  = index;
42  Shm_Unlock( lq_cb );
43}
Note: See TracBrowser for help on using the repository browser.