source: rtems/c/src/lib/libbsp/shmdr/addlq.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[ac7d5ef0]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 *
[03f2154e]11 *  COPYRIGHT (c) 1989-1997.
[ac7d5ef0]12 *  On-Line Applications Research Corporation (OAR).
[03f2154e]13 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]14 *
[03f2154e]15 *  The license and distribution terms for this file may in
16 *  the file LICENSE in this distribution or at
17 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]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.