OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [shmdr/] [poll.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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: poll.c,v 1.2 2001-09-27 12:01:12 chris Exp $
19
 */
20
 
21
#include <rtems.h>
22
#include <rtems/score/sysstate.h>
23
#include <rtems/libio.h>
24
 
25
#include "shm_driver.h"
26
 
27
void 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.