source: rtems/c/src/libchip/shmdr/poll.c @ 60b791ad

4.104.114.84.95
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/98 at 23:46:28

updated copyright to 1998

  • Property mode set to 100644
File size: 1.3 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 *
[60b791ad]11 *  COPYRIGHT (c) 1989-1998.
[ac7d5ef0]12 *  On-Line Applications Research Corporation (OAR).
[03f2154e]13 *  Copyright assigned to U.S. Government, 1994.
[ac7d5ef0]14 *
[98e4ebf5]15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
[03f2154e]17 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]18 *
[b06e68ef]19 *  $Id$
[ac7d5ef0]20 */
21
22#include <rtems.h>
[5e9b32b]23#include <rtems/score/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.