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

4.104.114.84.95
Last change on this file since df49c60 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
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.OARcorp.com/rtems/license.html.
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.