source: rtems/c/src/libchip/shmdr/poll.c @ 3495c57

4.104.115
Last change on this file since 3495c57 was 3495c57, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 03:49:08

Whitespace removal.

  • 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.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <rtems.h>
16#include <rtems/score/sysstate.h>
17#include <rtems/libio.h>
18
19#include <assert.h>
20
21#include "shm_driver.h"
22
23rtems_timer_service_routine Shm_Poll_TSR(
24  rtems_id  id,
25  void     *ignored_address
26)
27{
28  uint32_t tmpfront;
29
30  /*
31   *  This should NEVER happen but just in case.
32   */
33  if (!_System_state_Is_up(_System_state_Get()))
34    return;
35
36  tmpfront = Shm_Local_receive_queue->front;
37  if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) {
38    rtems_multiprocessing_announce();
39    Shm_Interrupt_count++;
40  }
41
42  (void) rtems_timer_reset( id );
43}
44
45void Shm_install_timer(void)
46{
47  rtems_id          id;
48  rtems_status_code status;
49
50  status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
51  assert( !status );
52
53  status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
54  assert( !status );
55}
56
Note: See TracBrowser for help on using the repository browser.