source: rtems/c/src/libchip/shmdr/poll.c @ 9eef52b

4.104.114.84.95
Last change on this file since 9eef52b was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 17, 1998 at 11:46:28 PM

updated copyright to 1998

  • Property mode set to 100644
File size: 1.3 KB
Line 
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-1998.
12 *  On-Line Applications Research Corporation (OAR).
13 *  Copyright assigned to U.S. Government, 1994.
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.OARcorp.com/rtems/license.html.
18 *
19 *  $Id$
20 */
21
22#include <rtems.h>
23#include <rtems/score/sysstate.h>
24#include <rtems/libio.h>
25
26#include "shm.h"
27
28void Shm_Poll()
29{
30  rtems_unsigned32 tmpfront;
31  rtems_libio_ioctl_args_t args;
32
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);
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;
47      if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
48      {
49          rtems_multiprocessing_announce();
50          Shm_Interrupt_count++;
51      }
52  }
53}
Note: See TracBrowser for help on using the repository browser.