Commit dbc90f6b authored by jdelange's avatar jdelange
Browse files

* po-hi-c/src/po_hi_gqueue.c

 * po-hi-c/src/drivers/po_hi_driver_rasta_serial.c
 * po-hi-c/src/drivers/po_hi_driver_linux_serial.c
   - Make sure that the use of two serial ports in the RASTA 
     driver is working.



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@2784 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 421685e5
...@@ -61,14 +61,6 @@ void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id) ...@@ -61,14 +61,6 @@ void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id)
__po_hi_msg_reallocate (&msg); __po_hi_msg_reallocate (&msg);
n = read (po_hi_c_driver_serial_fd_read, &(msg.content[0]), __PO_HI_MESSAGES_MAX_SIZE); n = read (po_hi_c_driver_serial_fd_read, &(msg.content[0]), __PO_HI_MESSAGES_MAX_SIZE);
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Message: 0x");
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__PO_HI_DEBUG_DEBUG ("%x", msg.content[ts]);
}
__PO_HI_DEBUG_DEBUG ("\n");
if (n == -1) if (n == -1)
{ {
...@@ -89,6 +81,15 @@ void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id) ...@@ -89,6 +81,15 @@ void __po_hi_c_driver_serial_linux_poller (const __po_hi_device_id dev_id)
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] read() returns %d\n", n); __PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] read() returns %d\n", n);
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Message: 0x");
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__PO_HI_DEBUG_DEBUG ("%x", msg.content[ts]);
}
__PO_HI_DEBUG_DEBUG ("\n");
swap_pointer = (unsigned long*) &msg.content[0]; swap_pointer = (unsigned long*) &msg.content[0];
swap_value = *swap_pointer; swap_value = *swap_pointer;
*swap_pointer = __po_hi_swap_byte (swap_value); *swap_pointer = __po_hi_swap_byte (swap_value);
......
...@@ -70,12 +70,12 @@ void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id) ...@@ -70,12 +70,12 @@ void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id)
int n; int n;
int ts; int ts;
uint8_t* ptr; uint8_t* ptr;
__po_hi_request_t __po_hi_c_driver_rasta_serial_request; __po_hi_request_t request;
__po_hi_msg_t __po_hi_c_driver_rasta_serial_msg; __po_hi_msg_t msg;
ts = __PO_HI_MESSAGES_MAX_SIZE; ts = __PO_HI_MESSAGES_MAX_SIZE;
ptr = &(__po_hi_c_driver_rasta_serial_msg.content[0]); ptr = &(msg.content[0]);
__po_hi_msg_reallocate (&__po_hi_c_driver_rasta_serial_msg); __po_hi_msg_reallocate (&msg);
while (ts > 0) while (ts > 0)
{ {
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Poller waits for incoming message (%d bytes are required)!\n", ts); __PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Poller waits for incoming message (%d bytes are required)!\n", ts);
...@@ -94,19 +94,16 @@ void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id) ...@@ -94,19 +94,16 @@ void __po_hi_c_driver_serial_rasta_poller (const __po_hi_device_id dev_id)
} }
} }
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Message received by poller: 0x"); msg.length = __PO_HI_MESSAGES_MAX_SIZE;
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__PO_HI_DEBUG_DEBUG ("%x", __po_hi_c_driver_rasta_serial_msg.content[ts]);
}
__PO_HI_DEBUG_DEBUG ("\n");
__po_hi_c_driver_rasta_serial_msg.length = __PO_HI_MESSAGES_MAX_SIZE; __po_hi_unmarshall_request (&request,
&msg);
__po_hi_unmarshall_request (&__po_hi_c_driver_rasta_serial_request, if (request.port > __PO_HI_NB_PORTS)
&__po_hi_c_driver_rasta_serial_msg); {
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Invalid port number (%d), will not deliver", request.port);
__po_hi_main_deliver (&__po_hi_c_driver_rasta_serial_request); }
__po_hi_main_deliver (&request);
} }
extern amba_confarea_type* __po_hi_driver_rasta_common_get_bus (); extern amba_confarea_type* __po_hi_driver_rasta_common_get_bus ();
...@@ -259,18 +256,10 @@ int __po_hi_c_driver_serial_rasta_sender (const __po_hi_task_id task_id, const _ ...@@ -259,18 +256,10 @@ int __po_hi_c_driver_serial_rasta_sender (const __po_hi_task_id task_id, const _
__po_hi_msg_reallocate (&msg); __po_hi_msg_reallocate (&msg);
request->port = destination_port; request->port = destination_port;
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Destination port= %d\n", destination_port); __PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Destination port= %d, send through device %d (fd=%d)\n", destination_port, dev_id, po_hi_c_driver_rasta_serial_fd_write[dev_id]);
__po_hi_marshall_request (request, &msg); __po_hi_marshall_request (request, &msg);
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] Message sent: 0x");
for (ts = 0 ; ts < __PO_HI_MESSAGES_MAX_SIZE ; ts++)
{
__PO_HI_DEBUG_DEBUG ("%x", msg.content[ts]);
}
__PO_HI_DEBUG_DEBUG ("\n");
n = write (po_hi_c_driver_rasta_serial_fd_write[dev_id], &msg, __PO_HI_MESSAGES_MAX_SIZE); n = write (po_hi_c_driver_rasta_serial_fd_write[dev_id], &msg, __PO_HI_MESSAGES_MAX_SIZE);
__PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] write() returns %d\n", n); __PO_HI_DEBUG_DEBUG ("[RASTA SERIAL] write() returns %d\n", n);
......
...@@ -289,7 +289,6 @@ rtems_id __po_hi_gqueues_barriers[__PO_HI_NB_TASKS]; ...@@ -289,7 +289,6 @@ rtems_id __po_hi_gqueues_barriers[__PO_HI_NB_TASKS];
__po_hi_gqueues_woffsets[id][port] = (__po_hi_gqueues_woffsets[id][port] + 1 ) % __po_hi_gqueues_sizes[id][port]; __po_hi_gqueues_woffsets[id][port] = (__po_hi_gqueues_woffsets[id][port] + 1 ) % __po_hi_gqueues_sizes[id][port];
__po_hi_gqueues_used_size[id][port]++; __po_hi_gqueues_used_size[id][port]++;
__PO_HI_INSTRUMENTATION_VCD_WRITE("r%d p%d.%d\n", __po_hi_gqueues_used_size[id][port], id, port); __PO_HI_INSTRUMENTATION_VCD_WRITE("r%d p%d.%d\n", __po_hi_gqueues_used_size[id][port], id, port);
__po_hi_gqueues_global_history[id][__po_hi_gqueues_global_history_woffset[id]] = port; __po_hi_gqueues_global_history[id][__po_hi_gqueues_global_history_woffset[id]] = port;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment