source: rtems/c/src/lib/libbsp/shmdr/poll.c @ 546aa4f

Last change on this file since 546aa4f was 8c99365, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:36

2003-09-04 Joel Sherrill <joel@…>

  • addlq.c, cnvpkt.c, dump.c, fatal.c, getlq.c, getpkt.c, init.c, initlq.c, intr.c, mpci.h, mpisr.c, poll.c, receive.c, retpkt.c, send.c, setckvec.c, shm_driver.h: URL for license changed.
  • 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-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#include <rtems.h>
22#include <rtems/score/sysstate.h>
23#include <rtems/libio.h>
24
25#include "shm_driver.h"
26
27void Shm_Poll()
28{
29  rtems_unsigned32 tmpfront;
30  rtems_libio_ioctl_args_t args;
31
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);
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;
46      if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
47      {
48          rtems_multiprocessing_announce();
49          Shm_Interrupt_count++;
50      }
51  }
52}
Note: See TracBrowser for help on using the repository browser.