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, 1990, 1991, 1992, 1993, 1994. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * All rights assigned to U.S. Government, 1994. |
---|
14 | * |
---|
15 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
16 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
17 | * notice must appear in all copies of this file and its derivatives. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | |
---|
22 | #include <rtems.h> |
---|
23 | #include <rtems/sysstate.h> |
---|
24 | #include <rtems/libio.h> |
---|
25 | |
---|
26 | #include "shm.h" |
---|
27 | |
---|
28 | void Shm_Poll() |
---|
29 | { |
---|
30 | rtems_unsigned32 tmpfront; |
---|
31 | rtems_libio_ioctl_args_t args; |
---|
32 | |
---|
33 | /* invoke clock isr */ |
---|
34 | args.iop = 0; |
---|
35 | args.command = rtems_build_name('I', 'S', 'R', ' '); |
---|
36 | (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args); |
---|
37 | |
---|
38 | /* |
---|
39 | * Check for msgs only if we are "up" |
---|
40 | * This avoids a race condition where we may get a clock |
---|
41 | * interrupt before MPCI has completed its init |
---|
42 | */ |
---|
43 | |
---|
44 | if (_System_state_Is_up(_System_state_Get())) |
---|
45 | { |
---|
46 | tmpfront = Shm_Local_receive_queue->front; |
---|
47 | if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) |
---|
48 | { |
---|
49 | rtems_multiprocessing_announce(); |
---|
50 | Shm_Interrupt_count++; |
---|
51 | } |
---|
52 | } |
---|
53 | } |
---|