source: rtems/c/src/libchip/shmdr/poll.c @ 48bfd992

4.104.114.84.95
Last change on this file since 48bfd992 was 48bfd992, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/99 at 19:58:02

Renamed shm.h to shm_driver.h to avoid conflicts with POSIX shm.h.

Renamed file shmsupp/intr.c in some BSPs to shmsupp/cause_intr.c to
avoid conflict with rtems/src/intr.c (Classic API Interrupt Manager).

  • 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 *
[08311cc3]11 *  COPYRIGHT (c) 1989-1999.
[ac7d5ef0]12 *  On-Line Applications Research Corporation (OAR).
13 *
[98e4ebf5]14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
[03f2154e]16 *  http://www.OARcorp.com/rtems/license.html.
[ac7d5ef0]17 *
[b06e68ef]18 *  $Id$
[ac7d5ef0]19 */
20
21#include <rtems.h>
[5e9b32b]22#include <rtems/score/sysstate.h>
[b06e68ef]23#include <rtems/libio.h>
24
[48bfd992]25#include "shm_driver.h"
[ac7d5ef0]26
27void Shm_Poll()
28{
29  rtems_unsigned32 tmpfront;
[b06e68ef]30  rtems_libio_ioctl_args_t args;
[ac7d5ef0]31
[b06e68ef]32  /* invoke clock isr */
33  args.iop = 0;
34  args.command = rtems_build_name('I', 'S', 'R', ' ');
35  (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args);
[88d594a]36
37  /*
38   * Check for msgs only if we are "up"
39   * This avoids a race condition where we may get a clock
40   * interrupt before MPCI has completed its init
41   */
42 
43  if (_System_state_Is_up(_System_state_Get()))
44  {
45      tmpfront = Shm_Local_receive_queue->front;
[b06e68ef]46      if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
47      {
48          rtems_multiprocessing_announce();
49          Shm_Interrupt_count++;
[12f86efd]50      }
[88d594a]51  }
[ac7d5ef0]52}
Note: See TracBrowser for help on using the repository browser.