source: rtems/c/src/libchip/shmdr/poll.c @ 6279149

4.115
Last change on this file since 6279149 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  This routine polls to see if a packet has arrived.  If one
3 *  has it informs the executive. It uses a Classic API Timer
4 *
5 *  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13#include <rtems.h>
14#include <rtems/score/sysstate.h>
15#include <rtems/libio.h>
16
17#include <assert.h>
18
19#include "shm_driver.h"
20
21rtems_timer_service_routine Shm_Poll_TSR(
22  rtems_id  id,
23  void     *ignored_address
24)
25{
26  uint32_t tmpfront;
27
28  /*
29   *  This should NEVER happen but just in case.
30   */
31  if (!_System_state_Is_up(_System_state_Get()))
32    return;
33
34  tmpfront = Shm_Local_receive_queue->front;
35  if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) {
36    rtems_multiprocessing_announce();
37    Shm_Interrupt_count++;
38  }
39
40  (void) rtems_timer_reset( id );
41}
42
43void Shm_install_timer(void)
44{
45  rtems_id          id;
46  rtems_status_code status;
47
48  status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
49  assert( !status );
50
51  status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
52  assert( !status );
53}
54
Note: See TracBrowser for help on using the repository browser.