source: rtems/c/src/lib/libbsp/shmdr/poll.c @ 18c5378

4.104.114.84.95
Last change on this file since 18c5378 was 18c5378, checked in by Joel Sherrill <joel.sherrill@…>, on 09/22/95 at 15:35:48

moving files around and adding the exec/wrapup directory

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[ac7d5ef0]1/*  void Shm_Poll()
2 *
3 *  This routine polls to see if a packet has arrived.  If one
4 *  has it informs the executive.  It is typically called from
5 *  the clock tick interrupt service routine.
6 *
7 *  Input parameters:  NONE
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 *
[b06e68ef]19 *  $Id$
[ac7d5ef0]20 */
21
22#include <rtems.h>
[18c5378]23#include <rtems/core/sysstate.h>
[b06e68ef]24#include <rtems/libio.h>
25
[ac7d5ef0]26#include "shm.h"
27
28void Shm_Poll()
29{
30  rtems_unsigned32 tmpfront;
[b06e68ef]31  rtems_libio_ioctl_args_t args;
[ac7d5ef0]32
[b06e68ef]33  /* invoke clock isr */
34  args.iop = 0;
35  args.command = rtems_build_name('I', 'S', 'R', ' ');
36  (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args);
[88d594a]37
38  /*
39   * Check for msgs only if we are "up"
40   * This avoids a race condition where we may get a clock
41   * interrupt before MPCI has completed its init
42   */
43 
44  if (_System_state_Is_up(_System_state_Get()))
45  {
46      tmpfront = Shm_Local_receive_queue->front;
[b06e68ef]47      if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
48      {
49          rtems_multiprocessing_announce();
50          Shm_Interrupt_count++;
[12f86efd]51      }
[88d594a]52  }
[ac7d5ef0]53}
Note: See TracBrowser for help on using the repository browser.