Ejemplo n.º 1
0
static void mpci_send_packet(uint32_t destination_node, rtems_packet_prefix *prefix)
{
	intercom_packet *packet = packet_of_prefix(prefix);
	if (destination_node != MPCI_ALL_NODES) {
		qoriq_intercom_send_packet((int) destination_node - 1, packet);
	} else {
		uint32_t self = ppc_processor_id();
		int other = self == 0 ? 1 : 0;

		qoriq_intercom_send_packet(other, packet);
	}
}
Ejemplo n.º 2
0
static void receive_task(rtems_task_argument arg)
{
  uart_bridge_master_control *control = (uart_bridge_master_control *) arg;
  intercom_type type = control->type;

  int fd = open(control->device_path, O_RDONLY);
  assert(fd >= 0);

  serial_settings(fd);

  while (true) {
    intercom_packet *packet = qoriq_intercom_allocate_packet(
      type,
      INTERCOM_SIZE_64
    );
    ssize_t in = read(fd, packet->data, packet->size - 1);
    if (in > 0) {
      packet->size = (size_t) in;
      qoriq_intercom_send_packet(QORIQ_UART_BRIDGE_SLAVE_CORE, packet);
    } else {
      qoriq_intercom_free_packet(packet);
    }
  }
}