source: rtems/c/src/libchip/shmdr/send.c @ ee4f57d

4.104.114.84.95
Last change on this file since ee4f57d was ee4f57d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/23/04 at 09:59:52

2004-03-23 Ralf Corsepius <ralf_corsepius@…>

  • libchip/ide/ata.c, libchip/ide/ata_internal.h, libchip/ide/ide_controller.c, libchip/ide/ide_ctrl_cfg.h, libchip/ide/ide_ctrl_io.h, libchip/network/cs8900.c, libchip/network/dec21140.c, libchip/network/elnk.c, libchip/network/if_fxp.c, libchip/network/open_eth.c, libchip/network/open_eth.h, libchip/network/sonic.c, libchip/network/sonic.h, libchip/rtc/icm7170.c, libchip/rtc/icm7170.h, libchip/rtc/icm7170_reg.c, libchip/rtc/icm7170_reg2.c, libchip/rtc/icm7170_reg4.c, libchip/rtc/icm7170_reg8.c, libchip/rtc/m48t08.c, libchip/rtc/m48t08.h, libchip/rtc/m48t08_reg.c, libchip/rtc/m48t08_reg2.c, libchip/rtc/m48t08_reg4.c, libchip/rtc/m48t08_reg8.c, libchip/rtc/rtc.h, libchip/serial/mc68681.c, libchip/serial/mc68681.h, libchip/serial/mc68681_reg.c, libchip/serial/mc68681_reg2.c, libchip/serial/mc68681_reg4.c, libchip/serial/mc68681_reg8.c, libchip/serial/ns16550.c, libchip/serial/ns16550_p.h, libchip/serial/serial.h, libchip/serial/z85c30.c, libchip/serial/z85c30.h, libchip/serial/z85c30_p.h, libchip/serial/z85c30_reg.c, libchip/shmdr/addlq.c, libchip/shmdr/cnvpkt.c, libchip/shmdr/dump.c, libchip/shmdr/fatal.c, libchip/shmdr/getlq.c, libchip/shmdr/init.c, libchip/shmdr/initlq.c, libchip/shmdr/intr.c, libchip/shmdr/poll.c, libchip/shmdr/send.c, libchip/shmdr/shm_driver.h: Convert to using c99 fixed-size types.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*  Shm_Send_packet
2 *
3 *  This routine is the shared memory driver locked queue write
4 *  MPCI driver routine.  This routine sends the specified packet
5 *  to the destination specified by "node".  A "node" value of
6 *  zero designates that this packet is to be broadcasted.
7 *
8 *  Input parameters:
9 *    node          - destination of this packet (0 = broadcast)
10 *    packet        - address of packet
11 *
12 *  Output parameters: NONE
13 *
14 *  COPYRIGHT (c) 1989-1999.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#include <rtems.h>
25#include "shm_driver.h"
26
27struct pkt_cpy {
28  uint32_t   packet[MAX_PACKET_SIZE/4];
29};
30
31rtems_mpci_entry Shm_Send_packet(
32  uint32_t   node,
33  rtems_packet_prefix *packet
34)
35{
36  Shm_Envelope_control *ecb, *tmp_ecb;
37  uint32_t   nnum;
38
39  ecb = Shm_Packet_prefix_to_envelope_control_pointer( packet );
40  if ( node ) {
41    Shm_Build_preamble( ecb, node );
42    Shm_Build_postamble( ecb );
43    Shm_Append_to_receive_queue( node, ecb );
44    (*Shm_Configuration->cause_intr)( node );
45  }
46  else {
47    for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ )
48      if ( Shm_Local_node != nnum ) {
49        tmp_ecb = Shm_Allocate_envelope();
50        if ( !tmp_ecb )
51          rtems_fatal_error_occurred( SHM_NO_FREE_PKTS );
52        Shm_Build_preamble( tmp_ecb, nnum );
53        *((struct pkt_cpy *)tmp_ecb->packet) = *((struct pkt_cpy *)packet);
54        Shm_Build_postamble( tmp_ecb );
55        Shm_Append_to_receive_queue( nnum, tmp_ecb );
56        (*Shm_Configuration->cause_intr)( nnum );
57      }
58    Shm_Free_envelope( ecb );
59  }
60}
Note: See TracBrowser for help on using the repository browser.